Пример #1
0
    protected bool HandleMissingData()
    {
        if (Manager == null)
        {
            Manager = InAudioInstanceFinder.DataManager;
            if (Manager == null)
            {
                ErrorDrawer.MissingAudioManager();
            }
        }

        if (Manager != null)
        {
            bool areAnyMissing = ErrorDrawer.IsDataMissing(Manager);

            if (areAnyMissing)
            {
                Manager.Load();
            }
            if (ErrorDrawer.IsAllDataMissing(Manager))
            {
                ErrorDrawer.AllDataMissing(Manager);
                return(false);
            }
            if (ErrorDrawer.IsDataMissing(Manager))
            {
                ErrorDrawer.MissingData(Manager);
                return(false);
            }
            else
            {
                return(true);
            }
        }
        else
        {
            return(false);
        }
    }
Пример #2
0
    void OnGUI()
    {
        CheckForClose();
        if (Manager == null)
        {
            Manager = InAudioInstanceFinder.DataManager;
            if (Manager == null)
            {
                ErrorDrawer.MissingAudioManager();
            }
        }
        if (Manager != null)
        {
            bool missingaudio      = Manager.AudioTree == null;
            bool missingaudioEvent = Manager.EventTree == null;
            bool missingbus        = Manager.BusTree == null;
            bool missingBank       = Manager.BankLinkTree == null;

            bool areAllMissing = missingaudio && missingaudioEvent && missingbus && missingBank;
            bool areAnyMissing = missingaudio || missingaudioEvent || missingbus || missingBank;

            if (areAllMissing)
            {
                ErrorDrawer.AllDataMissing(Manager);
                return;
            }
            else if (areAnyMissing)
            {
                DrawMissingDataCreation();
                return;
            }
        }
        else
        {
            return;
        }

        isDirty = false;

        EditorGUILayout.BeginVertical();
        EditorGUILayout.EndVertical();
        selectedToolbar = GUILayout.Toolbar(selectedToolbar, toolbarOptions);

        if (selectedToolbar == 0)
        {
            isDirty |= busGUI.OnGUI(LeftWidth, (int)position.height);
        }

        if (selectedToolbar == 1)
        {
            isDirty |= bankGUI.OnGUI(LeftWidth, (int)position.height);
        }

        if (selectedToolbar == 2)
        {
            isDirty |= integrityGUI.OnGUI();
        }

        if (selectedToolbar == 3)
        {
            DrawMissingDataCreation();

            DrawStartFromScratch();
        }

        if (isDirty)
        {
            Repaint();
        }

        PostOnGUI();
    }