Exemplo n.º 1
0
 void Update()
 {
     if (Managers.GameManager.State == Enums.GameStates.CardSelection)
     {
         if (CustomInput.BoolFreshPress(CustomInput.UserInput.Up, thisPlayerIndex))
         {
             Navigator.Navigate(CustomInput.UserInput.Up, okayButton.gameObject);
         }
         if (CustomInput.BoolFreshPress(CustomInput.UserInput.Down, thisPlayerIndex))
         {
             Navigator.Navigate(CustomInput.UserInput.Down, okayButton.gameObject);
         }
         if (CustomInput.BoolFreshPress(CustomInput.UserInput.Right, thisPlayerIndex))
         {
             Navigator.Navigate(CustomInput.UserInput.Right, okayButton.gameObject);
         }
         if (CustomInput.BoolFreshPress(CustomInput.UserInput.Left, thisPlayerIndex))
         {
             Navigator.Navigate(CustomInput.UserInput.Left, okayButton.gameObject);
         }
         if (CustomInput.BoolFreshPressDeleteOnRead(CustomInput.UserInput.Accept, thisPlayerIndex))
         {
             Navigator.CallSubmit();
         }
     }
 }
Exemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (CustomInput.BoolFreshPressDeleteOnRead(CustomInput.UserInput.Cancel) && (!Settings.activeInHierarchy))
     {
         ChangeToSettings();
     }
 }
Exemplo n.º 3
0
 void Update()
 {
     if (this.state != State.waiting)
     {
         this.image.sprite = this.backgrounds[this.whichBackgroundForWhichPage[currentPage]];
         this.text.text    = this.currentText.ToString();
     }
     if (this.state == State.waiting)
     {
         if (start)
         {
             GameState.Instance.State = Enums.GameState.Cutscene;
             this.state     = State.displaying;
             this.pageChars = this.pageStrings[this.currentPage].ToCharArray();
             this.canvas.SetActive(true);
         }
     }
     else if (this.state == State.displaying)
     {
         if (CustomInput.BoolFreshPressDeleteOnRead(CustomInput.UserInput.Pause))
         {
             this.currentText = new System.Text.StringBuilder(this.pageStrings[this.currentPage]);
             this.state       = State.paused;
         }
         else
         {
             if (this.currentLetter == 0)
             {
                 this.currentText.Append(this.pageChars[(int)currentLetter]);
             }
             int   a    = (int)(currentLetter);
             float temp = this.textSpeed;
             if (CustomInput.BoolHeld(CustomInput.UserInput.Accept) || CustomInput.BoolHeld(CustomInput.UserInput.Attack))
             {
                 temp *= 2;
             }
             this.currentLetter += temp * Time.deltaTime;
             if (a < (int)this.currentLetter && this.currentLetter < this.pageChars.Length)
             {
                 this.currentText.Append(this.pageChars[(int)this.currentLetter]);
                 this.sound.PlaySong(0);
             }
             if (this.currentLetter >= this.pageChars.Length)
             {
                 //currentText = new System.Text.StringBuilder(pageStrings[currentPage]);
                 this.state = State.paused;
             }
         }
     }
     else
     {
         if (CustomInput.BoolFreshPressDeleteOnRead(CustomInput.UserInput.Accept) ||
             CustomInput.BoolFreshPressDeleteOnRead(CustomInput.UserInput.Attack) ||
             CustomInput.BoolFreshPressDeleteOnRead(CustomInput.UserInput.Pause))
         {
             this.currentLetter = 0;
             this.currentPage++;
             if (this.currentPage >= this.pages.Length)
             {
                 this.text.text           = "";
                 GameState.Instance.State = Enums.GameState.Playing;
                 this.canvas.SetActive(false);
                 Destroy(this.gameObject);
             }
             else
             {
                 this.pageChars   = this.pageStrings[this.currentPage].ToCharArray();
                 this.currentText = new System.Text.StringBuilder();
                 this.state       = State.displaying;
             }
         }
     }
 }
Exemplo n.º 4
0
    public void Update()
    {
        //Debug.Log(es.currentSelectedGameObject);
        if (CustomInput.BoolFreshPress(CustomInput.UserInput.Pause))
        {
            if (hideBehaviour.OnScreen)
            {
                this.DismissDialog();
            }
            else
            {
                this.BringUpPause();
            }
        }

        if (hideBehaviour.OnScreenPos.position == hideBehaviour.transform.position && hideBehaviour.OnScreen)
        {
            if (CustomInput.BoolFreshPress(CustomInput.UserInput.Cancel))
            {
                this.DismissDialog();
            }
        }

        if (!this.IsMultiplayer)
        {
            if (GameManager.Player1Win)
            {
                this.BringUpWin();
                GameManager.Player1Win = false;
            }
            else if (GameManager.Player1Lose)
            {
                this.BringUpLose();
                GameManager.Player1Lose = false;
            }
        }
        else
        {
            if (GameManager.Player1Win)
            {
                this.BringUpP1Win();
                GameManager.Player1Win = false;
            }
            else if (GameManager.Player1Lose)
            {
                this.BringUpP2Win();
                GameManager.Player1Lose = false;
            }
        }

        if (GameManager.State == Enums.GameStates.Paused)
        {
            if (CustomInput.BoolFreshPress(CustomInput.UserInput.Up))
            {
                Navigator.Navigate(CustomInput.UserInput.Up, CurrentDefault);
            }
            if (CustomInput.BoolFreshPress(CustomInput.UserInput.Down))
            {
                Navigator.Navigate(CustomInput.UserInput.Down, CurrentDefault);
            }
            if (CustomInput.BoolFreshPress(CustomInput.UserInput.Right))
            {
                Navigator.Navigate(CustomInput.UserInput.Right, CurrentDefault);
            }
            if (CustomInput.BoolFreshPress(CustomInput.UserInput.Left))
            {
                Navigator.Navigate(CustomInput.UserInput.Left, CurrentDefault);
            }
            if (CustomInput.BoolFreshPressDeleteOnRead(CustomInput.UserInput.Accept))
            {
                Navigator.CallSubmit();
            }
        }
    }