static DashEditorCore() { SetExecutionOrder(typeof(DashVariablesController), -501); SetExecutionOrder(typeof(DashController), -500); EditorConfig = DashEditorConfig.Create(); RuntimeConfig = DashRuntimeConfig.Create(); Previewer = new DashEditorPreviewer(); CheckDashVersion(); EditorApplication.playModeStateChanged += OnPlayModeChanged; AssemblyReloadEvents.afterAssemblyReload += OnAfterAssemblyReload; AssemblyReloadEvents.beforeAssemblyReload += OnBeforeAssemblyReload; SceneView.duringSceneGui -= OnSceneGUI; SceneView.duringSceneGui += OnSceneGUI; }
public static DashRuntimeConfig Create() { DashRuntimeConfig config = (DashRuntimeConfig)AssetDatabase.LoadAssetAtPath("Assets/Resources/DashRuntimeConfig.asset", typeof(DashRuntimeConfig)); if (config == null) { config = CreateInstance <DashRuntimeConfig>(); if (config != null) { if (!AssetDatabase.IsValidFolder("Assets/Resources")) { AssetDatabase.CreateFolder("Assets", "Resources"); } AssetDatabase.CreateAsset(config, "Assets/Resources/DashRuntimeConfig.asset"); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); } } return(config); }