Exemple #1
0
 private void OnFocus()
 {
     _defineToAdd = null;
     if (_scriptingDefinesScriptableObject)
     {
         return;
     }
     _scriptingDefinesScriptableObject = ScriptingDefinesScriptableObject.CreateOrLoadAsset();
 }
Exemple #2
0
        public static ScriptingDefinesScriptableObject CreateOrLoadAsset()
        {
            if (File.Exists(assetPath))
            {
                return(AssetDatabase.LoadAssetAtPath <ScriptingDefinesScriptableObject>(assetPath));
            }

            ScriptingDefinesScriptableObject instance = CreateInstance <ScriptingDefinesScriptableObject>();

            instance.availableScriptingDefines = new ScriptDefineInfo[0];
            AssetDatabase.CreateAsset(instance, assetPath);
            EditorUtility.SetDirty(instance);
            AssetDatabase.SaveAssets();
            return(instance);
        }
Exemple #3
0
 private void Awake()
 {
     _scriptingDefinesScriptableObject = ScriptingDefinesScriptableObject.CreateOrLoadAsset();
     titleContent = new GUIContent("Scripting Defines");
 }