Example #1
0
    void Update()
    {
        if (Time.time - startTime > 2.5F)
        {
            delayCanvas.enabled = false;
            gameCanvas.enabled  = true;
        }
        if (Combinations.GetCurrentCombinationPlayer(1).Count > 0)
        {
            bool PlayerHIt = false;
            PlayerHIt = Combinations.IsSameCombinationPlayer(combination.GetCombination(), 1);
            if (!Combinations.CompareCombinationPlayer(combination.GetCombination(), 1))
            {
                DoParticle(WrongCombo1);
                Combinations.ResetPlayer(1);
                soundManager.Play("WrongCombo", false);
            }
            if (PlayerHIt)
            {
                PlayerHit(2);
            }
        }

        if (Combinations.GetCurrentCombinationPlayer(2).Count > 0)
        {
            bool PlayerHIt = false;
            PlayerHIt = Combinations.IsSameCombinationPlayer(combination.GetCombination(), 2);

            if (!Combinations.CompareCombinationPlayer(combination.GetCombination(), 2))
            {
                DoParticle(WrongCombo2);
                Combinations.ResetPlayer(2);
                soundManager.Play("WrongCombo", false);
            }
            if (PlayerHIt)
            {
                PlayerHit(1);
            }
        }

        if (winner != 0)
        {
            winCanvas.enabled  = true;
            gameCanvas.enabled = false;
            StartCoroutine("GoMenu");
        }
    }
Example #2
0
 private void Update()
 {
     if (combiManager.GetCombination()[pos] == VSCombinationHandler.Button.RED)
     {
         this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.red;
     }
     if (combiManager.GetCombination()[pos] == VSCombinationHandler.Button.BLUE)
     {
         this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.blue;
     }
     if (combiManager.GetCombination()[pos] == VSCombinationHandler.Button.YELLOW)
     {
         this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.yellow;
     }
     if (combiManager.GetCombination()[pos] == VSCombinationHandler.Button.GREEN)
     {
         this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.green;
     }
 }
Example #3
0
    private void Update()
    {
        count = 0;
        if (main)
        {
            if (combiManager.GetCombination()[pos] == VSCombinationHandler.Button.RED)
            {
                this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.red;
            }
            if (combiManager.GetCombination()[pos] == VSCombinationHandler.Button.BLUE)
            {
                this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.blue;
            }
            if (combiManager.GetCombination()[pos] == VSCombinationHandler.Button.YELLOW)
            {
                this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.yellow;
            }
            if (combiManager.GetCombination()[pos] == VSCombinationHandler.Button.GREEN)
            {
                this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.green;
            }
        }

        if (this.GetComponentInChildren <SpriteRenderer>().enabled == false)
        {
            this.GetComponentInChildren <SpriteRenderer>().enabled = true;
        }
        if (player1)
        {
            if (VSHandler.GetCurrentCombinationPlayer(1).Count - 1 < pos)
            {
                this.GetComponentInChildren <SpriteRenderer>().enabled = false;
            }
            else
            {
                foreach (CombinationHandler.Button x in VSHandler.GetCurrentCombinationPlayer(1))
                {
                    if (count == pos)
                    {
                        if (x == CombinationHandler.Button.RED)
                        {
                            this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.red;
                        }
                        if (x == CombinationHandler.Button.BLUE)
                        {
                            this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.blue;
                        }
                        if (x == CombinationHandler.Button.YELLOW)
                        {
                            this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.yellow;
                        }
                        if (x == CombinationHandler.Button.GREEN)
                        {
                            this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.green;
                        }
                    }
                    count++;
                }
            }
        }
        if (player2)
        {
            if (VSHandler.GetCurrentCombinationPlayer(2).Count - 1 < pos)
            {
                this.GetComponentInChildren <SpriteRenderer>().enabled = false;
            }
            else
            {
                foreach (CombinationHandler.Button x in VSHandler.GetCurrentCombinationPlayer(2))
                {
                    if (count == pos)
                    {
                        if (x == CombinationHandler.Button.RED)
                        {
                            this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.red;
                        }
                        if (x == CombinationHandler.Button.BLUE)
                        {
                            this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.blue;
                        }
                        if (x == CombinationHandler.Button.YELLOW)
                        {
                            this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.yellow;
                        }
                        if (x == CombinationHandler.Button.GREEN)
                        {
                            this.GetComponentInChildren <SpriteRenderer>().sprite = combiManager.green;
                        }
                    }
                    count++;
                }
            }
        }
    }