Hi, I am encountering a problem in a WebGL build.
A WorkPlanController (singleton MonoBehaviour) defining in a subclass the member “data” as the reference to the struct:
public class WorkPlanController : Singleton<WorkPlanController>
{
public class WorkPlanModule
{
public ModuleData data;
}
}
I have an ScriptableObject (accessed via Singleton) containing a list of modules and every module holds a struct of data:
The ScriptableObject:
public class WorkplanData : SingletonScriptableObject<WorkplanData>
{
public WorkPlanController.WorkPlanModule[] module = null;
}
[Serializable]
public struct ModuleData
{
public string name;
public string description;
public UnityEngine.Object processFile; <<== problem
}
At runtime I’am accessing the data via
foreach (var module in WorkPlanController.Instance.data.module)
{
//throw exception in WebGL because module.data.processFile == null
string processPath = $"Processes/{module.data.processFile.name}";
}
In the Editor it works very well, file pathes and files can be read without a problem. But in the WebGL build the reference to the GameEngine.Object module.data.processFile is null.
I don’t know if relevant, but the source files put in to processFile resides in Assets/StreamingAssets/
Would be great if someone can shed some light on the problem.
Thanks