/// <summary> /// コンストラクタ /// </summary> static EditorRuntime() { EditorApplication.hierarchyWindowItemOnGUI += HierarchyWindowItemCallback; EditorApplication.projectWindowItemOnGUI += ProjectWindowItemCallback; if (PreferenceSettings.i.EnableObjectStat.Value) { ObjectStat.Enable(); } }
public static void PreferencesGUI() { //if( !prefsLoaded ) { // text = EditorPrefs.GetString( TEXT_KEY, "" ); // prefsLoaded = true; //} var i = PreferenceSettings.i; GUI.changed = false; i.EnableHierarchyItem.Value = EditorGUILayout.ToggleLeft("ヒエラルキーの拡張", i.EnableHierarchyItem, GUILayout.ExpandWidth(false)); EditorGUI.indentLevel++; using (new EditorGUI.DisabledScope(!i.EnableHierarchyItem)) { i.HierarchyActive.Value = EditorGUILayout.ToggleLeft("アクティブトグル", i.HierarchyActive, GUILayout.ExpandWidth(false)); i.HierarchyPrefab.Value = EditorGUILayout.ToggleLeft("プレハブ状態アイコン", i.HierarchyPrefab, GUILayout.ExpandWidth(false)); i.HierarchyAnim.Value = EditorGUILayout.ToggleLeft("Monitor for Animation Curve", i.HierarchyAnim, GUILayout.ExpandWidth(false)); } EditorGUI.indentLevel--; if (GUI.changed) { EditorApplication.RepaintHierarchyWindow(); } GUI.changed = false; i.EnableProjectItem.Value = EditorGUILayout.ToggleLeft("プロジェクトブラウザの拡張", i.EnableProjectItem.Value, GUILayout.ExpandWidth(false)); if (GUI.changed) { EditorApplication.RepaintProjectWindow(); } GUI.changed = false; EditorGUI.indentLevel++; GUI.changed = false; var _color = EditorGUILayout.ColorField("行の色", i.m_color); if (GUI.changed) { i.m_color = _color; EditorUtils.RepaintEditorWindow(); EditorPrefs.SetFloat(COLOR_TAG_R, _color.r); EditorPrefs.SetFloat(COLOR_TAG_G, _color.g); EditorPrefs.SetFloat(COLOR_TAG_B, _color.b); EditorPrefs.SetFloat(COLOR_TAG_A, _color.a); } EditorGUI.indentLevel--; PreferenceSettings.i.EnableSceneView2GameView.Value = EditorGUILayout.ToggleLeft("SceneViewのカメラを任意のカメラに連動する機能", PreferenceSettings.i.EnableSceneView2GameView.Value); if (GUI.changed) { SceneView2GameView.menu_ToggleSceneView2GameView(); } GUI.changed = false; PreferenceSettings.i.EnableSceneSelector.Value = EditorGUILayout.ToggleLeft("SceneSelector", PreferenceSettings.i.EnableSceneSelector.Value); if (GUI.changed) { EditorApplication.RepaintHierarchyWindow(); } #if LOCAL_TEST PreferenceSettings.i.EnableTimeScaleSlider.Value = EditorGUILayout.ToggleLeft("タイムスケールスライダー", PreferenceSettings.i.EnableTimeScaleSlider.Value); GUI.changed = false; PreferenceSettings.i.EnableObjectStat.Value = EditorGUILayout.ToggleLeft("ObjectStat", PreferenceSettings.i.EnableObjectStat.Value); if (GUI.changed) { if (PreferenceSettings.i.EnableObjectStat.Value) { ObjectStat.Enable(); } else { ObjectStat.Disable(); } } #endif GUILayout.Space(8f); if (i.s_preferencesGUICallback != null) { i.s_preferencesGUICallback(); } }