mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-21 01:36:03 +08:00
Fix error on deleting script during compilation
This commit is contained in:
parent
1fff90cbf2
commit
3d7dbbc7e2
@ -17,7 +17,7 @@ namespace XNodeEditor {
|
|||||||
// Check script type. Return if deleting a non-node script
|
// Check script type. Return if deleting a non-node script
|
||||||
UnityEditor.MonoScript script = obj as UnityEditor.MonoScript;
|
UnityEditor.MonoScript script = obj as UnityEditor.MonoScript;
|
||||||
System.Type scriptType = script.GetClass ();
|
System.Type scriptType = script.GetClass ();
|
||||||
if (scriptType != typeof (XNode.Node) && !scriptType.IsSubclassOf (typeof (XNode.Node))) return AssetDeleteResult.DidNotDelete;
|
if (scriptType == null || (scriptType != typeof (XNode.Node) && !scriptType.IsSubclassOf (typeof (XNode.Node)))) return AssetDeleteResult.DidNotDelete;
|
||||||
|
|
||||||
// Find all ScriptableObjects using this script
|
// Find all ScriptableObjects using this script
|
||||||
string[] guids = AssetDatabase.FindAssets ("t:" + scriptType);
|
string[] guids = AssetDatabase.FindAssets ("t:" + scriptType);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user