コード例 #1
0
        void DrawTools()
        {
            GUILayout.BeginArea(toolSection);
            GUILayout.Label("Achievement Manager - Tools", skin.box);

            if (AchievementCreator == null)
            {
                GUILayout.EndArea();
                return;
            }

            if (GUILayout.Button("Achievements", skin.button, GUILayout.Height(60)))
            {
                TPAchievementToolsWindow.OpenToolWindow(TPAchievementToolsWindow.Tool.Achievements);
            }
            if (GUILayout.Button("Notification", skin.button, GUILayout.Height(60)))
            {
                TPAchievementToolsWindow.OpenToolWindow(TPAchievementToolsWindow.Tool.Notification);
            }
            //if (GUILayout.Button("Layout", skin.button, GUILayout.Height(60)))
            //{
            //    TPAchievementToolsWindow.OpenToolWindow(TPAchievementToolsWindow.Tool.Layout);
            //}
            GUILayout.EndArea();
        }
コード例 #2
0
        public static void OpenToolWindow(Tool _tool)
        {
            if (window != null)
            {
                window.Close();
            }

            window = (TPAchievementToolsWindow)GetWindow(typeof(TPAchievementToolsWindow));

            currentScene = EditorSceneManager.GetActiveScene().name;
            EditorApplication.hierarchyWindowChanged += hierarchyWindowChanged;

            window.minSize = new Vector2(windowSize, windowSize);
            window.maxSize = new Vector2(windowSize, windowSize);
            window.Show();
            tool = _tool;
            AssetDatabase.OpenAsset(TPAchievementDesigner.AchievementCreator);
        }