I am loading a Scene from assetbundle in WebGl and unable to join or create random room and stuck on this error:
writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!
I am using a node.js API to load assetbundel based on user data and to parse JSON I use SimpleJSON
In Editor its working fine.
I am using PUN2 and Unity 2019.20.f1
This is the complete Log Screenshot .
The code to build assetbundle
[MenuItem("Assets/Build AssetBundles")]
static void BuildAllAssetBundles()
{
string assetBundleDirectory = "Assets/StreamingAssets";
if (!Directory.Exists(Application.streamingAssetsPath))
{
Directory.CreateDirectory(assetBundleDirectory);
}
BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, EditorUserBuildSettings.activeBuildTarget);
}
And the coroutine to load assetbundel
IEnumerator Loadmodel(string bundleUrl)
{
using (WWW web = new WWW(bundleUrl))
{
yield return web;
AssetBundle remoteAssetBundle = web.assetBundle;
if (remoteAssetBundle == null)
{
Debug.LogError("Failed to download AssetBundle!");
yield break;
}
string[] scenePaths = remoteAssetBundle.GetAllScenePaths(); //loading all scene path
Debug.Log(scenePaths);
string sceneName = System.IO.Path.GetFileNameWithoutExtension(scenePaths[0]);
PhotonNetwork.LoadLevel(sceneName);
}
yield return null;
}
