// Token: 0x0600001B RID: 27 RVA: 0x00002DCC File Offset: 0x00000FCC
        private static void DrawBoolPref(BDPreferences pref, string text, PreferenceChangeHandler callback)
        {
            bool @bool = BehaviorDesignerPreferences.GetBool(pref);
            bool flag  = GUILayout.Toggle(@bool, text, new GUILayoutOption[0]);

            if (flag != @bool)
            {
                BehaviorDesignerPreferences.SetBool(pref, flag);
                callback(pref, flag);
                if (pref == BDPreferences.EditablePrefabInstances && flag && BehaviorDesignerPreferences.GetBool(BDPreferences.BinarySerialization))
                {
                    BehaviorDesignerPreferences.SetBool(BDPreferences.BinarySerialization, false);
                    callback(BDPreferences.BinarySerialization, false);
                }
                else if (pref == BDPreferences.BinarySerialization && flag && BehaviorDesignerPreferences.GetBool(BDPreferences.EditablePrefabInstances))
                {
                    BehaviorDesignerPreferences.SetBool(BDPreferences.EditablePrefabInstances, false);
                    callback(BDPreferences.EditablePrefabInstances, false);
                }
            }
        }
 private static void ResetPrefs()
 {
     BehaviorDesignerPreferences.SetBool(BDPreferences.ShowWelcomeScreen, true);
     BehaviorDesignerPreferences.SetBool(BDPreferences.ShowSceneIcon, true);
     BehaviorDesignerPreferences.SetBool(BDPreferences.ShowHierarchyIcon, true);
     BehaviorDesignerPreferences.SetBool(BDPreferences.OpenInspectorOnTaskSelection, false);
     BehaviorDesignerPreferences.SetBool(BDPreferences.OpenInspectorOnTaskDoubleClick, false);
     BehaviorDesignerPreferences.SetBool(BDPreferences.FadeNodes, true);
     BehaviorDesignerPreferences.SetBool(BDPreferences.EditablePrefabInstances, false);
     BehaviorDesignerPreferences.SetBool(BDPreferences.PropertiesPanelOnLeft, true);
     BehaviorDesignerPreferences.SetBool(BDPreferences.MouseWhellScrolls, false);
     BehaviorDesignerPreferences.SetBool(BDPreferences.FoldoutFields, true);
     BehaviorDesignerPreferences.SetBool(BDPreferences.CompactMode, false);
     BehaviorDesignerPreferences.SetBool(BDPreferences.SnapToGrid, true);
     BehaviorDesignerPreferences.SetBool(BDPreferences.ShowTaskDescription, true);
     BehaviorDesignerPreferences.SetBool(BDPreferences.BinarySerialization, true);
     BehaviorDesignerPreferences.SetBool(BDPreferences.ErrorChecking, true);
     BehaviorDesignerPreferences.SetBool(BDPreferences.UpdateCheck, true);
     BehaviorDesignerPreferences.SetBool(BDPreferences.AddGameGUIComponent, false);
     BehaviorDesignerPreferences.SetInt(BDPreferences.GizmosViewMode, 2);
 }
        // Token: 0x0600001A RID: 26 RVA: 0x00002C30 File Offset: 0x00000E30
        public static void DrawPreferencesPane(PreferenceChangeHandler callback)
        {
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.ShowWelcomeScreen, "Show welcome screen", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.ShowSceneIcon, "Show Behavior Designer icon in the scene", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.ShowHierarchyIcon, "Show Behavior Designer icon in the hierarchy window", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.OpenInspectorOnTaskSelection, "Open inspector on single task selection", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.OpenInspectorOnTaskDoubleClick, "Open inspector on task double click", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.FadeNodes, "Fade tasks after they are done running", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.EditablePrefabInstances, "Allow edit of prefab instances", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.PropertiesPanelOnLeft, "Position properties panel on the left", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.MouseWhellScrolls, "Mouse wheel scrolls graph view", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.FoldoutFields, "Grouped fields start visible", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.CompactMode, "Compact mode", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.SnapToGrid, "Snap to grid", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.ShowTaskDescription, "Show selected task description", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.ErrorChecking, "Realtime error checking", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.SelectOnBreakpoint, "Select GameObject if a breakpoint is hit", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.UpdateCheck, "Check for updates", callback);
            BehaviorDesignerPreferences.DrawBoolPref(BDPreferences.AddGameGUIComponent, "Add Game GUI Component", callback);
            bool @bool = BehaviorDesignerPreferences.GetBool(BDPreferences.BinarySerialization);

            if (EditorGUILayout.Popup("Serialization", (!@bool) ? 1 : 0, BehaviorDesignerPreferences.serializationString, new GUILayoutOption[0]) != ((!@bool) ? 1 : 0))
            {
                BehaviorDesignerPreferences.SetBool(BDPreferences.BinarySerialization, !@bool);
                callback(BDPreferences.BinarySerialization, !@bool);
            }
            int @int = BehaviorDesignerPreferences.GetInt(BDPreferences.GizmosViewMode);
            int num  = (int)((Behavior.GizmoViewMode)EditorGUILayout.EnumPopup("Gizmos View Mode", (Behavior.GizmoViewMode)@int, new GUILayoutOption[0]));

            if (num != @int)
            {
                BehaviorDesignerPreferences.SetInt(BDPreferences.GizmosViewMode, num);
                callback(BDPreferences.GizmosViewMode, num);
            }
            if (GUILayout.Button("Restore to Defaults", EditorStyles.miniButtonMid, new GUILayoutOption[0]))
            {
                BehaviorDesignerPreferences.ResetPrefs();
            }
        }
 // Token: 0x06000018 RID: 24 RVA: 0x000029E0 File Offset: 0x00000BE0
 public static void InitPrefernces()
 {
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[0]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.ShowWelcomeScreen, true);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[1]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.ShowSceneIcon, true);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[2]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.ShowHierarchyIcon, true);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[3]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.OpenInspectorOnTaskSelection, false);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[3]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.OpenInspectorOnTaskSelection, false);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[5]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.FadeNodes, true);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[6]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.EditablePrefabInstances, false);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[7]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.PropertiesPanelOnLeft, true);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[8]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.MouseWhellScrolls, false);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[9]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.FoldoutFields, true);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[10]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.CompactMode, false);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[11]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.SnapToGrid, true);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[12]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.ShowTaskDescription, true);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[13]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.BinarySerialization, true);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[14]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.ErrorChecking, true);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[15]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.SelectOnBreakpoint, false);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[16]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.UpdateCheck, true);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[17]))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.AddGameGUIComponent, false);
     }
     if (!EditorPrefs.HasKey(BehaviorDesignerPreferences.PrefString[18]))
     {
         BehaviorDesignerPreferences.SetInt(BDPreferences.GizmosViewMode, 2);
     }
     if (BehaviorDesignerPreferences.GetBool(BDPreferences.EditablePrefabInstances) && BehaviorDesignerPreferences.GetBool(BDPreferences.BinarySerialization))
     {
         BehaviorDesignerPreferences.SetBool(BDPreferences.BinarySerialization, false);
     }
 }
Esempio n. 5
0
        public void OnGUI()
        {
            GUI.DrawTexture(this.m_WelcomeScreenImageRect, this.m_WelcomeScreenImage);
            GUI.Label(this.m_WelcomeIntroRect, "Welcome To Behavior Designer", BehaviorDesignerUtility.WelcomeScreenIntroGUIStyle);
            GUI.DrawTexture(this.m_SamplesImageRect, this.m_SamplesImage);
            GUI.Label(this.m_SamplesHeaderRect, "Samples", BehaviorDesignerUtility.WelcomeScreenTextHeaderGUIStyle);
            GUI.Label(this.m_SamplesDescriptionRect, "Download sample projects to get a feel for Behavior Designer.", BehaviorDesignerUtility.WelcomeScreenTextDescriptionGUIStyle);
            GUI.DrawTexture(this.m_DocImageRect, this.m_DocImage);
            GUI.Label(this.m_DocHeaderRect, "Documentation", BehaviorDesignerUtility.WelcomeScreenTextHeaderGUIStyle);
            GUI.Label(this.m_DocDescriptionRect, "Browser our extensive online documentation.", BehaviorDesignerUtility.WelcomeScreenTextDescriptionGUIStyle);
            GUI.DrawTexture(this.m_VideoImageRect, this.m_VideoImage);
            GUI.Label(this.m_VideoHeaderRect, "Videos", BehaviorDesignerUtility.WelcomeScreenTextHeaderGUIStyle);
            GUI.Label(this.m_VideoDescriptionRect, "Watch our tutorial videos which cover a wide variety of topics.", BehaviorDesignerUtility.WelcomeScreenTextDescriptionGUIStyle);
            GUI.DrawTexture(this.m_ForumImageRect, this.m_ForumImage);
            GUI.Label(this.m_ForumHeaderRect, "Forums", BehaviorDesignerUtility.WelcomeScreenTextHeaderGUIStyle);
            GUI.Label(this.m_ForumDescriptionRect, "Join the forums!", BehaviorDesignerUtility.WelcomeScreenTextDescriptionGUIStyle);
            GUI.DrawTexture(this.m_ContactImageRect, this.m_ContactImage);
            GUI.Label(this.m_ContactHeaderRect, "Contact", BehaviorDesignerUtility.WelcomeScreenTextHeaderGUIStyle);
            GUI.Label(this.m_ContactDescriptionRect, "We are here to help.", BehaviorDesignerUtility.WelcomeScreenTextDescriptionGUIStyle);
            GUI.Label(this.m_VersionRect, "Version 1.5.5");
            bool flag = GUI.Toggle(this.m_ToggleButtonRect, BehaviorDesignerPreferences.GetBool(BDPreferences.ShowWelcomeScreen), "Show at Startup");

            if (flag != BehaviorDesignerPreferences.GetBool(BDPreferences.ShowWelcomeScreen))
            {
                BehaviorDesignerPreferences.SetBool(BDPreferences.ShowWelcomeScreen, flag);
            }
            EditorGUIUtility.AddCursorRect(this.m_SamplesImageRect, (MouseCursor)4);
            EditorGUIUtility.AddCursorRect(this.m_SamplesHeaderRect, (MouseCursor)4);
            EditorGUIUtility.AddCursorRect(this.m_SamplesDescriptionRect, (MouseCursor)4);
            EditorGUIUtility.AddCursorRect(this.m_DocImageRect, (MouseCursor)4);
            EditorGUIUtility.AddCursorRect(this.m_DocHeaderRect, (MouseCursor)4);
            EditorGUIUtility.AddCursorRect(this.m_DocDescriptionRect, (MouseCursor)4);
            EditorGUIUtility.AddCursorRect(this.m_VideoImageRect, (MouseCursor)4);
            EditorGUIUtility.AddCursorRect(this.m_VideoHeaderRect, (MouseCursor)4);
            EditorGUIUtility.AddCursorRect(this.m_VideoDescriptionRect, (MouseCursor)4);
            EditorGUIUtility.AddCursorRect(this.m_ForumImageRect, (MouseCursor)4);
            EditorGUIUtility.AddCursorRect(this.m_ForumHeaderRect, (MouseCursor)4);
            EditorGUIUtility.AddCursorRect(this.m_ForumDescriptionRect, (MouseCursor)4);
            EditorGUIUtility.AddCursorRect(this.m_ContactImageRect, (MouseCursor)4);
            EditorGUIUtility.AddCursorRect(this.m_ContactHeaderRect, (MouseCursor)4);
            EditorGUIUtility.AddCursorRect(this.m_ContactDescriptionRect, (MouseCursor)4);
            if (Event.current.type == (EventType)1)
            {
                Vector2 mousePosition = Event.current.mousePosition;
                if (this.m_SamplesImageRect.Contains(mousePosition) || this.m_SamplesHeaderRect.Contains(mousePosition) || this.m_SamplesDescriptionRect.Contains(mousePosition))
                {
                    Application.OpenURL("http://www.opsive.com/assets/BehaviorDesigner/samples.php");
                }
                else if (this.m_DocImageRect.Contains(mousePosition) || this.m_DocHeaderRect.Contains(mousePosition) || this.m_DocDescriptionRect.Contains(mousePosition))
                {
                    Application.OpenURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php");
                }
                else if (this.m_VideoImageRect.Contains(mousePosition) || this.m_VideoHeaderRect.Contains(mousePosition) || this.m_VideoDescriptionRect.Contains(mousePosition))
                {
                    Application.OpenURL("http://www.opsive.com/assets/BehaviorDesigner/videos.php");
                }
                else if (this.m_ForumImageRect.Contains(mousePosition) || this.m_ForumHeaderRect.Contains(mousePosition) || this.m_ForumDescriptionRect.Contains(mousePosition))
                {
                    Application.OpenURL("http://www.opsive.com/forum");
                }
                else if (this.m_ContactImageRect.Contains(mousePosition) || this.m_ContactHeaderRect.Contains(mousePosition) || this.m_ContactDescriptionRect.Contains(mousePosition))
                {
                    Application.OpenURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=12");
                }
            }
        }