Example #1
0
    void Init()
    {
        Get = this;

        actualEnemy = (Enemy)0;

        // makes object persistant so that they don't get destroyed on scene unloading
        DontDestroyOnLoad(persistantContainer);

        // initializes all text content
        gameData.Init();

        // initializes all managers
        panelManager.Init(() =>
        {
            eventSystem    = FindObjectOfType <EventSystem>();
            actualTutorial = FindObjectOfType <Tutorial>();

            // gets refs to popups and closes them without cool effect (as if it was never here)
            popupManager.GetAllScenePopups();
            popupManager.ForceCancelPop();

            audioProjectManager.FadeMusicIn();

            SetAllTextFont();
        });

        audioManager.Init();
        audioProjectManager.Init(panelManager.fadeDuration, popupManager.fadeDuration, () => { return(panelManager.nextPanel); }, () => { return(panelManager.actualPanel); }, () => { return(popupManager.actualPopup); });
        popupManager.Init(audioProjectManager.FadePopupMusicOut);

        PlugPanelEvents();
        PlugPopupEvents();

        // real start of game (these actions are normally called during transition events)
        popupManager.GetAllScenePopups();
        popupManager.ForceCancelPop();
        InitTitlePanel();

        audioProjectManager.FadeMusicIn();

        Skinning.Init(selectedSkin);
        SetAllTextFont();
    }