Forums › 💬 NodeCanvas › ⚙️ Support › 2018.3 upgrade issues › Reply To: 2018.3 upgrade issues
Finally had a chance to upgrade to 2018.3 .. This was all that was needed. Thanks for your help
|
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 35 36 37 38 39 40 41 42 43 44 45 46 47 |
public void Validate(){ //everything bellow is relevant to bound graphs only if (!graphIsBound || Application.isPlaying || UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode){ return; } var prefabType = UnityEditor.PrefabUtility.GetPrefabType(this); if (boundGraphInstance == null){ #if !UNITY_2018_3_OR_NEWER if (prefabType == UnityEditor.PrefabType.Prefab){ if (graph == null){ graph = (Graph)ScriptableObject.CreateInstance(graphType); UnityEditor.AssetDatabase.AddObjectToAsset(graph, this); string path = UnityEditor.AssetDatabase.GetAssetPath(graph); if ( !string.IsNullOrEmpty( path ) ) { UnityEditor.EditorApplication.delayCall += ()=>{ UnityEditor.AssetDatabase.ImportAsset( path ); }; } } boundGraphInstance = graph; } else { boundGraphInstance = (Graph)ScriptableObject.CreateInstance(graphType); } #else boundGraphInstance = (Graph)ScriptableObject.CreateInstance(graphType); #endif } boundGraphInstance.Deserialize(boundGraphSerialization, false, boundGraphObjectReferences); #if !UNITY_2018_3_OR_NEWER boundGraphInstance.hideFlags = HideFlags.None; #endif (boundGraphInstance as UnityEngine.Object).name = this.name + " " + graphType.Name; boundGraphInstance.Validate(); graph = boundGraphInstance; boundGraphSerialization = graph.Serialize(false, boundGraphObjectReferences); graph.agent = this; graph.blackboard = this.blackboard; } |
