private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

        //Instanciação de valores
        PositionNowClicked  = 0;
        CurrentGamePosition = new List <int>();

        //Instanciação Win-Loose
        YouWin   = GameObject.FindGameObjectWithTag("Win");
        YouLoose = GameObject.FindGameObjectWithTag("Loose");

        YouWin.SetActive(false);
        YouLoose.SetActive(false);

        //Player Config
        AllowedToClick = false;

        //Rounds Inicias, depois alterar
        Rounds = 3;
    }
Exemplo n.º 2
0
    private void Update()
    {
        if (!Bots[0].activeSelf && !Bots[1].activeSelf && !Bots[2].activeSelf && !Bots[3].activeSelf)
        {
            YouWin.SetActive(true);
            TimerStart = false;
            MoveChar.isControllChar = false;
        }

        if (!TimerStart)
        {
            seconds    = 30f;
            Text.color = new Color(87, 69, 50, 255);
            TimeSnap(seconds);
        }

        if (TimerStart == true && !Healths.isGameOver)
        {
            seconds -= 1 * Time.deltaTime;

            TimeSnap(seconds);

            if (seconds <= 10)
            {
                Text.color = new Color(1, 0, 0);
            }

            if (seconds <= 0)
            {
                seconds = 0;
                if (!GamePlayer)
                {
                    AIBot.instance.DelayEnd();
                    Bots[SelectBot].GetComponent <AIBot>().enabled = false;
                    NextMovePlayerNow();
                }
                else
                {
                    MoveChar.isControllChar = false;
                    Aiming.instance.Delay();
                    NextMoveBot();
                }
                TimerStart = false;
            }
        }

        if (NextMovePlayer == true)
        {
            NextMovePlayerNow();
            NextMovePlayer = false;
        }
    }
 //Caso vc ganhe ou perca sete tais telas
 public void setYouWinScreen()
 {
     YouWin.SetActive(true);
 }