Example #1
0
        public AsyncOperation ChangeState(eUIState state)
        {
            switch (state)
            {
            case eUIState.Login:
                ResourceRequest operation = UILoader.LoadUIAsync(eUIPrefab.Login);
                operation.completed += onUILoadDone;
                return(operation);
            }

            return(null);
        }
Example #2
0
    public void ActiveUI(eUIState state)
    {
        mFieldUI.SetActive(state == eUIState.UIState_Field);

        mBattleUI.SetActive(state == eUIState.UIState_Battle);
        if (state == eUIState.UIState_Battle)
        {
            BattleUI_Control bcUI = mBattleUI.GetComponent<BattleUI_Control> ();
            if (bcUI != null)
            {
                bcUI.DestroyAllHPGauge ();
            }
        }
    }
    // Update is called once per frame
    void Update()
    {
        Canvas.ForceUpdateCanvases();
        //switch on enum
        //enable / disable elements of ui & manage UI anims

        //clear ui to base state
        if (currUIState == eUIState.BASE)
        {
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                currUIState = eUIState.PAUSEMENU;
                stateSwitch();
            }
        }
        else if (currUIState == eUIState.PAUSEMENU)
        {
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                currUIState = eUIState.BASE;
                stateSwitch();
            }
        }
        else if (currUIState == eUIState.ENDGAME)
        {
            //turn on the buttons after the animation is finished
            if (timer == 0)
            {
                timer = 6;
            }
            if (timer != 0)
            {
                timer -= Time.deltaTime;
            }
            if (timer < 0)
            {
                foreach (GameObject Button in EndButtons)
                {
                    Button.SetActive(true);
                }
            }
        }
    }