Forums › 💬 NodeCanvas › ⚙️ Support › 2018.3 upgrade issues › Reply To: 2018.3 upgrade issues
Hello,
You could replace the Validate method with the code found in the Validate method in the latest version, which handles whether or not we are under Unity 2018.3. Here is the code for your convenience:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
public void Validate() { //everything here is relevant to bound graphs only if ( graphIsBound && !Application.isPlaying && !UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode ) { #if !UNITY_2018_3_OR_NEWER //works in 2018.3 without this code var prefabType = UnityEditor.PrefabUtility.GetPrefabType(this); if ( prefabType == UnityEditor.PrefabType.Prefab ) { //Update from previous version. No longer store graph as sub-asset. if ( graph != null && UnityEditor.AssetDatabase.IsSubAsset(graph) ) { DestroyImmediate(graph, true); } } #endif if ( boundGraphInstance == null ) { boundGraphInstance = (Graph)ScriptableObject.CreateInstance(graphType); } #if !UNITY_2018_3_OR_NEWER //works in 2018.3 without this code boundGraphInstance.hideFlags = prefabType == UnityEditor.PrefabType.Prefab ? HideFlags.HideAndDontSave : HideFlags.None; #endif boundGraphInstance.Deserialize(boundGraphSerialization, false, boundGraphObjectReferences); ( boundGraphInstance as UnityEngine.Object ).name = this.name + " " + graphType.Name; boundGraphInstance.UpdateReferencesFromOwner(this); boundGraphInstance.Validate(); boundGraphSerialization = boundGraphInstance.Serialize(false, boundGraphObjectReferences); graph = boundGraphInstance; } } |
Let me know if that works for you.
Thanks.