コード例 #1
0
ファイル: ConditionRegister.cs プロジェクト: Evellex/Eldrinth
 private void LoadInstance()
 {
     instance = Resources.Load<ConditionRegister>("Augmenta/Condition Register.asset");
     conditionTypeNames = new string[instance.conditionTypes.Count];
     returnableConditionTypeNames = new string[instance.conditionTypes.Count];
     int i = 0;
     instance.conditionTypes.ForEach(x => { conditionTypeNames[i++] = x.ConditionName; });
 }
コード例 #2
0
        public static void SelectInstance()
        {
            string assetsPath = Application.dataPath;
            string folderPath = "Augmenta/Generic/Library/Data/Resources/Augmenta";
            string filename = "Condition Register.asset";

            registerInstance = AssetDatabase.LoadAssetAtPath<ConditionRegister>("Assets/" + folderPath + "/" + filename);
            if (registerInstance == null)
            {
                if (!System.IO.Directory.Exists(assetsPath + "/" + folderPath))
                    System.IO.Directory.CreateDirectory(assetsPath + "/" + folderPath);
                registerInstance = ScriptableObject.CreateInstance<ConditionRegister>();
                AssetDatabase.CreateAsset(registerInstance, "Assets/" + folderPath + "/" + filename);
            }
            EditorUtility.FocusProjectWindow();
            Selection.activeObject = registerInstance;
            EditorGUIUtility.PingObject(registerInstance);
        }
コード例 #3
0
ファイル: ConditionRegister.cs プロジェクト: Evellex/Eldrinth
 private void OnEnable()
 {
     if (instance == null)
         instance = this;
 }