构建Unity应用后,无法在我的Instantiate
文件夹中Resources
个对象。这是此构建的output_log.txt的摘录:
ArgumentException: The Object you want to instantiate is null.
at UnityEngine.Object.CheckNullArgument (System.Object arg, System.String message) [0x00000] in <filename unknown>:0
at UnityEngine.Object.Instantiate (UnityEngine.Object original, UnityEngine.Transform parent, Boolean instantiateInWorldSpace) [0x00000] in <filename unknown>:0
at UnityEngine.Object.Instantiate[GameObject] (UnityEngine.GameObject original, UnityEngine.Transform parent, Boolean worldPositionStays) [0x00000] in <filename unknown>:0
此错误与我的脚本找不到的预制件有关,并与以下几行有关:
GameObject radio_button = Resources.Load<GameObject>(GlobalConfiguration.Instance.RootPrefabs+"/RadioButton"
foreach (string type in toggle_names)
{
if (type == string.Empty || type == null) continue;
GameObject go = Instantiate(radio_button, parent, false);
(...)
GlobalConfiguration
包含RootPrefabs = "Prefabs";
。
这是预制件的问题,但是我也遇到了外部资源,例如JSON文件。我想念什么?
有关信息,我正在使用VRTK。