Beispiel #1
0
        private void OnGUI()
        {
            CheckForClose();

            if (!HandleMissingData())
            {
                return;
            }

            if (musicCreatorGUI == null)
            {
                musicCreatorGUI = new MusicCreatorGUI(this);
            }

            isDirty = false;


            try
            {
                DrawTop(topHeight);
                isDirty |= musicCreatorGUI.OnGUI(LeftWidth, (int)position.height - topHeight);
            }
            catch (ExitGUIException e)
            {
                throw e;
            }

            /*catch (ArgumentException e)
             * {
             * throw e;
             * }*/
            catch (Exception e)
            {
                if (e.GetType() != typeof(ArgumentException))
                {
                    Debug.LogException(e);

                    //While this catch was made to catch persistent errors,  like a missing null check, it can also catch other errors
                    EditorGUILayout.BeginVertical();
                    EditorGUILayout.HelpBox(
                        "An exception is getting caught while trying to draw this window.\nPlease report this bug to [email protected] and if possible how to reproduce it",
                        MessageType.Error);

                    EditorGUILayout.TextArea(e.ToString());
                    EditorGUILayout.EndVertical();
                }
            }


            if (isDirty)
            {
                Repaint();
            }

            PostOnGUI();
        }
Beispiel #2
0
        private void OnEnable()
        {
            BaseEnable();

            if (musicCreatorGUI == null)
            {
                musicCreatorGUI          = new MusicCreatorGUI(this);
                autoRepaintOnSceneChange = true;
            }
            musicCreatorGUI.OnEnable();
        }