Esempio n. 1
0
    protected bool HandleMissingData()
    {
        if (Manager == null)
        {
            Manager = InstanceFinder.DataManager;
            if (Manager == null)
            {
                ErrorDrawer.MissingAudioManager();
            }
        }

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

            if (areAnyMissing)
            {
                Manager.Load();
            }
            if (ErrorDrawer.IsDataMissing(Manager))
            {
                ErrorDrawer.MissingData(Manager);
                return(false);
            }
            else
            {
                return(true);
            }
        }
        else
        {
            return(false);
        }
    }
Esempio n. 2
0
    void OnGUI()
    {
        KeyboardWindowControls();
        if (Manager == null)
        {
            Manager = InstanceFinder.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 areAnyMissing = missingaudio || missingaudioEvent || missingbus || missingBank;

            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 - topHeight);
        }

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

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

            DrawStartFromScratch();
        }

        if (isDirty)
        {
            Repaint();
        }

        PostOnGUI();
    }