Beispiel #1
0
    public override void Enter()
    {
        gm            = context.GetGameManager();
        musicCtrl     = gm.GetMusicController();
        uiMng         = gm.GetUIManager();
        mainMenuPanel = uiMng.GetMenu <UIMenu_MainMenu>();

        uiMng.SetCurrentMenuAnimation <UIMenu_MainMenu>("MainMenuIn");
        CoroutineController.StartRoutine(() => mainMenuPanel.EnablePanelContainer(true), 0.01f);
        musicCtrl.PlayMainMenuClip();
        mainMenuPanel.StartGameButtonPressed = StartGameButtonPressed;
    }
Beispiel #2
0
    public override void Enter()
    {
        gm           = context.GetGameManager();
        uiMng        = gm.GetUIManager();
        endGamePanel = uiMng.GetMenu <UIMenu_EndGame>();
        spawnCtrl    = gm.GetSpawnController();
        printCtrl    = gm.GetPrintController();
        bgMng        = gm.GetBackgroundManager();
        musicCtrl    = gm.GetMusicController();

        endGamePanel.RetyButtonPressed     = RetryButtonPressed;
        endGamePanel.MainMenuButtonPressed = MainMenuButtonPressed;

        printCtrl.EndGameAnimation(OnPrinterAnimationEnd);
    }
    public override void Enter()
    {
        startState = false;
        adsMng     = UnityAdsManager.instance;
        gm         = context.GetGameManager();
        spawnCtrl  = gm.GetSpawnController();
        uiMng      = gm.GetUIManager();
        shapeCtrl  = gm.GetShapeController();
        bgMng      = gm.GetBackgroundManager();
        printCtrl  = gm.GetPrintController();
        scoreCtrl  = gm.GetScoreController();
        musicCtrl  = gm.GetMusicController();

        PrintController.OnShapeGuessed += HandleOnShapeGuessed;
        PrintController.OnShapeWrong   += HandleOnShapeWrong;
        ShapeController.OnShapeChanged += HandleOnShapeChange;
        ShapeController.OnNewShapeAdd  += HandleOnNewShapeAdd;
        gm.OnGameEnd += HandleOnGameEnd;

        gameplayPanel = uiMng.GetMenu <UIMenu_Gameplay>();
        printCtrl.EnableGraphic(false);
        uiMng.SetCurrentMenu <UIMenu_Gameplay>(0.5f, 0.5f, OnGameplayFadeIntCallback, OnGameplayFadeOutCallback);
    }
Beispiel #4
0
    public void StartPrep()
    {
        if (healthBar == null)
        {
            healthBar = transform.GetChild(0).gameObject.GetComponent <Slider>();
        }

        if (manaBar == null)
        {
            manaBar = transform.GetChild(1).gameObject.GetComponent <Slider>();
        }

        if (moveButtons == null)
        {
            moveButtons = transform.GetChild(2).gameObject;
        }

        if (fleeButton == null)
        {
            fleeButton = transform.GetChild(3).gameObject;
        }

        if (enemyHealthBar == null)
        {
            enemyHealthBar = transform.GetChild(4).gameObject.GetComponent <Slider>();
        }

        if (enemyNameText == null)
        {
            enemyNameText = transform.GetChild(5).gameObject.GetComponent <Text>();
        }

        if (healthText == null)
        {
            healthText = healthBar.GetComponentInChildren <Text>();
        }

        if (manaText == null)
        {
            manaText = manaBar.GetComponentInChildren <Text>();
        }

        if (enemyHealthText == null)
        {
            enemyHealthText = enemyHealthBar.GetComponentInChildren <Text>();
        }

        if (buildingButton == null)
        {
            buildingButton = transform.GetChild(6).gameObject;
        }

        if (buildingUI == null)
        {
            buildingUI = transform.GetChild(7).gameObject;
        }

        if (confirmButton == null)
        {
            confirmButton = transform.GetChild(8).gameObject;
        }

        if (cancelButton == null)
        {
            cancelButton = transform.GetChild(9).gameObject;
        }

        if (inventory == null)
        {
            inventory = transform.GetChild(10).GetComponent <Inventory>();
        }

        if (buildWarning == null)
        {
            buildWarning = transform.GetChild(11).gameObject;
        }

        if (floorLevel == null)
        {
            floorLevel = transform.GetChild(12).gameObject.GetComponent <Text>();
        }

        if (pauseMenuButton == null)
        {
            pauseMenuButton = transform.GetChild(13).gameObject;
        }

        if (pauseMenu == null)
        {
            pauseMenu = transform.GetChild(14).gameObject;
        }

        if (summoningCircleMenu == null)
        {
            summoningCircleMenu = transform.GetChild(15).gameObject;
        }

        if (textBox == null)
        {
            textBox = transform.GetChild(16).gameObject;
        }

        if (textCover == null)
        {
            textCover = transform.GetChild(17).gameObject;
        }

        if (skillIconParent == null)
        {
            skillIconParent = transform.GetChild(18).gameObject;
        }

        if (fadeScreen == null)
        {
            fadeScreen = transform.GetChild(-1).gameObject;
        }

        musicSoundController = GetComponent <MusicSoundController>();
        enemyHealthBar.gameObject.SetActive(false);
        enemyHealthText.gameObject.SetActive(false);
        enemyNameText.gameObject.SetActive(false);
        buildingUI.SetActive(false);
        confirmButton.SetActive(false);
        cancelButton.SetActive(false);
        inventory.gameObject.SetActive(true);
        buildWarning.SetActive(false);
        floorLevel.gameObject.SetActive(false);
        pauseMenu.SetActive(false);
        summoningCircleMenu.SetActive(false);
        textBox.SetActive(false);
        textCover.SetActive(false);
        skillIconParent.SetActive(false);

        BuildingSlotCheck();
        MovementToggleCircleCheck();
    }