Ejemplo n.º 1
0
        protected void ProcessNewLevelState(Level.State gstate)
        {
            HideAllScreens();

            if (gstate == Level.State.NonInit)
            {
                scrNoninit.gameObject.SetActive(true);
            }
            else if (gstate == Level.State.On)
            {
                scrIngame.gameObject.SetActive(true);
            }
            else if (gstate == Level.State.Failed)
            {
                scrDeath.gameObject.SetActive(true);

                // Set new values
                scrDeath.Find("txtDistance").GetComponent <Text>().text    = Mathf.FloorToInt(lvl.passedDistance).ToString();
                scrDeath.Find("txtScores").GetComponent <Text>().text      = lvl.scores.ToString();
                scrDeath.Find("txtDistanceMax").GetComponent <Text>().text = Globals.Instance.maxDistance.ToString();
                scrDeath.Find("txtScoresMax").GetComponent <Text>().text   = Globals.Instance.maxScores.ToString();
            }
            else if (gstate == Level.State.Paused)
            {
                scrIngame.gameObject.SetActive(true);
                scrPause.gameObject.SetActive(true);
            }
        }
Ejemplo n.º 2
0
 protected void UpdateHud()
 {
     Level.State lvlState = lvl.state;
     if (lvlState == Level.State.On || lvlState == Level.State.Paused)
     {
         scrIngame.Find("txtScores").GetComponent <Text>().text   = lvl.scores.ToString();
         scrIngame.Find("txtDistance").GetComponent <Text>().text = Mathf.FloorToInt(lvl.passedDistance).ToString();
     }
 }
Ejemplo n.º 3
0
 public LevelStateChangedEventArgs(Level.State s)
 {
     State = s;
 }