Esempio n. 1
0
 public void UpdatePhase(Phase p)
 {
     currentPhase = p;
     if (currentPhase == Phase.Two)
     {
         StartCoroutine(DropBoxes());
     }
 }
Esempio n. 2
0
    void Update()
    {
        Debug.Log(MaxNumBoxes);
        GameObject g = GameObject.Find("Background");

        boxes = GameObject.Find("Background").GetComponentsInChildren <Box> ();

        if (boxes.Length > MaxNumBoxes)
        {
            GameObject.Find("Background").GetComponent <BoxCreate> ().enabled = false;
        }
        else
        {
            if (currentPhase == Phase.Two)
            {
                GameObject.Find("Background").GetComponent <BoxCreate> ().enabled = false;
            }
            else
            {
                GameObject.Find("Background").GetComponent <BoxCreate> ().enabled = true;
            }
        }

        if (currentPhase == Phase.One)
        {
            if (boxes.Length == 0 && Input.GetKeyDown(KeyCode.Return))
            {
                currentPhase = Phase.One;
                SceneManager.LoadScene(2);
            }
        }
        Debug.Log(currentPhase);
        Debug.Log(GameOver);
        if (currentPhase == Phase.Two)
        {
            if (boxes.Length == 0)
            {
                currentPhase = Phase.One;
                SceneManager.LoadScene(2);
            }
        }


        /*for (int i = 0; i < boxes.Length; i++) {
         *
         *      if (character.displayPos == boxes [i].displayPos) {
         *              GameOver = true;
         *              currentPhase = Phase.One;
         *              Box.count = 0;
         *              SceneManager.LoadScene(0);
         *
         *      }
         * }*/
    }
Esempio n. 3
0
        public void AlertCurrentPhase(GameController.Phase phase)
        {
            switch (phase)
            {
            case GameController.Phase.Shuffle:
                imgPlayerTurn.sprite = gameController.Players[0].IsTurn ? spriteAllPlayerTurn[0] : spriteAllPlayerTurn[1];
                StartCoroutine("_ShowShufflePhaseAlert");
                break;

            case GameController.Phase.Battle:
                StartCoroutine("_ShowBattlePhaseAlert");
                break;
            }
        }
Esempio n. 4
0
 void Start()
 {
     //character = new Character ();
     currentPhase = Phase.One;
 }