protected void OnEnable() { _tabIndex = 0; _settings = UViewEditorUtils.GetSettings(); EditorApplication.playmodeStateChanged += HandlePlayStateChanged; }
protected void OnEnable() { _settings = target as UViewSettings; _propertySettingsPrefabsPath = serializedObject.FindProperty("prefabsPath"); _propertySettingsScriptsPath = serializedObject.FindProperty("scriptsPath"); _propertySettingsScriptTemplate = serializedObject.FindProperty("scriptTemplate"); _propertySettingsPrefabTemplate = serializedObject.FindProperty("prefabTemplate"); }
public static UViewSettings GetSettings() { string settingsPath = Path.Combine(UViewEditorUtils.kSettingsPath, UViewEditorUtils.kSettingsAssetName); UViewSettings settings = AssetDatabase.LoadAssetAtPath <UViewSettings>(settingsPath); if (settings == null) { UViewSettings defaults = AssetDatabase.LoadAssetAtPath <UViewSettings>(UViewEditorUtils.kDefaultSettingsPath); settings = GameObject.Instantiate <UViewSettings>(defaults); if (!Directory.Exists(UViewEditorUtils.kSettingsPath)) { Directory.CreateDirectory(UViewEditorUtils.kSettingsPath); } AssetDatabase.CreateAsset(settings, settingsPath); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); } return(settings); }
protected void OnEnable() { _settings = UViewEditorUtils.GetSettings(); _scriptPath = _settings.scriptsPath; _prefabPath = _settings.prefabsPath; }