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; }); }
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); }
private void OnEnable() { if (instance == null) instance = this; }