Exemplo n.º 1
0
    private void Update()
    {
        //if (Input.GetKeyDown(KeyCode.Space))
        //{
        //    RebindAnim();
        //}

        if (TrinaxGlobal.Instance.state != STATES.SCREENSAVER)
        {
            return;
        }

        if (animator.GetCurrentAnimatorStateInfo(0).normalizedTime > 1 && !animator.IsInTransition(0))
        {
            timer += Time.deltaTime;
        }

        if (timer > timeInterval)
        {
            timer = 0;
            OnScreenExit();
        }

        if (Input.anyKeyDown)
        {
            timer = 0;
            if (state == SCREENSAVER_STATE.QUEUE || state == SCREENSAVER_STATE.LEADER)
            {
                state = SCREENSAVER_STATE.MAIN;
                RebindAnim();
            }
        }
    }
    void Update()
    {
        if (TrinaxGlobal.Instance.state != STATE.SCREENSAVER)
        {
            return;
        }

        // Increment interval if animation is not playing
        if (screensaverAnim.GetCurrentAnimatorStateInfo(0).normalizedTime > 1 && !screensaverAnim.IsInTransition(0))
        {
            timer += Time.deltaTime;
        }

        if (timer > timeInterval)
        {
            timer = 0;
            OnScreenExit();
        }

        if (Input.GetMouseButtonDown(0) && !TrinaxCanvas.Instance.adminPanel.gameObject.activeSelf)
        {
            timer = 0;
            if (state != SCREENSAVER_STATE.MAIN_MENU)
            {
                state = SCREENSAVER_STATE.MAIN_MENU;
                RebindAnim(screensaverAnim);
            }
        }
    }
    public void ToScreensaver(SCREENSAVER_STATE _state = SCREENSAVER_STATE.MAIN_MENU)
    {
        GameEvents.GameResetEvent?.Invoke();

        //backgroundCanvas.Deactivate();

        screensaverController.state = _state;
        TrinaxGlobal.Instance.state = STATE.SCREENSAVER;
        canvasController.TransitToCanvas((int)TrinaxGlobal.Instance.state, durationToTransit);

        if (!useLocalLeaderboard)
        {
            APICalls.RunPopulateLeaderboard(AppManager.Instance.localLeaderboard.leaderboardDisplay).WrapErrors();
        }
        if (!string.IsNullOrEmpty(TrinaxGlobal.Instance.userData.interactionID))
        {
            APICalls.RunEndInteraction().WrapErrors();
        }
        else
        {
            return;
        }
    }
Exemplo n.º 4
0
    public void Init()
    {
        state = SCREENSAVER_STATE.MAIN;

        OnScreenEntry();
    }
Exemplo n.º 5
0
 public void SetState(SCREENSAVER_STATE _state)
 {
     state = _state;
 }