void OnEnable() { dragging = false; database = (qd_Database)Resources.LoadAssetAtPath(QD_DATABASE_PATH, typeof(qd_Database)); if (database == null) { database = InitDatabase(); } if (database.LoadDecalGroups(decalView)) { decalGroups = database.decalGroups; } InitGUI(); #if UNITY_4_3 Undo.undoRedoPerformed += this.UndoRedoPerformed; #endif HookSceneView(); this.minSize = new Vector2(365f, 275f); }
private qd_Database InitDatabase() { qd_Database db = ScriptableObject.CreateInstance <qd_Database>(); if (!Directory.Exists(Path.GetDirectoryName(QD_DATABASE_PATH))) { Directory.CreateDirectory(Path.GetDirectoryName(QD_DATABASE_PATH)); } AssetDatabase.CreateAsset(db, QD_DATABASE_PATH); return(db); }
void OnEnable() { dragging = false; database = (qd_Database)AssetDatabase.LoadAssetAtPath(QD_DATABASE_PATH, typeof(qd_Database)); if(database == null) database = InitDatabase(); if( database.LoadDecalGroups(decalView) ) decalGroups = database.decalGroups; InitGUI(); #if UNITY_4_3 Undo.undoRedoPerformed += this.UndoRedoPerformed; #endif HookSceneView(); this.minSize = new Vector2(365f, 275f); }