Unsupported type SceneReference
determinationlove opened this issue · 1 comments
determinationlove commented
I use Unity 2022.3.6f1
I assign a value to SceneName in a script that contains OnValidate()
[SerializeField] private SceneReference nextScene;
public string SceneName = "";
#if UNITY_EDITOR
void OnValidate()
{
SetMissionValue();
}
#endif
void Awake()
{
SetMissionValue();
}
void SetMissionValue()
{
if (nextScene.State == SceneReferenceState.Regular)
SceneName = nextScene.Name;
}
The editor throws an error:
Unsupported type SceneReference
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
determinationlove commented
oh my god
I found that this was just because I replaced UnityEngine.Object in the script with SceneReference.
The objects to which this script was applied in other scenes had not yet been assigned a SceneReference value.
When I assigned values to all SceneReferences, the error did not appear again.