Ejemplo n.º 1
0
    void EnterClues()
    {
        StopTimer();
        tallyState.SetActive(false);
        loginState.SetActive(false);
        clueState.SetActive(true);
        m_clues.Clear();
        m_submittedClueWords.Clear();

        int index = Random.Range(0, m_targets.Count);

        m_currentTarget = m_targets[index];
        m_usedTargets.Add(m_currentTarget);
        m_currentTarget.SetPattern();

        m_targets[index] = m_targets.Last();
        m_targets.RemoveAt(m_targets.Count - 1);

        string content = FormClueContent();
        var    guesser = m_playerList[m_guesserIndex];

        clueGuesserImage.sprite = guesser.sprite.sprite;

        Main.RaiseEvent(SpewEventCode.SendTarget, content);

        if (string.IsNullOrEmpty(ogClueInstructions))
        {
            ogClueInstructions = clueInstructionsLabel.text;
        }

        clueInstructionsLabel.text = string.Format(ogClueInstructions, guesser.Name);

        int time = CLUE_TIME;

        if (m_guesserIndex == 0)
        {
            time = CLUE_TIME * 2;
        }
        else if (m_playerList.Count > 3)
        {
            time = CLUE_TIME + (CLUE_TIME_PER_EXTRA_PLAYER * (Main.MAX_PLAYERS_IN_ROOM - m_playerList.Count));
        }

        timerRoutine = StartCoroutine(TimerRoutine(time, () => SetState(State.Guess)));

        AudioManager.Instance.Play("ClueMusic");

        DOTween.KillAll();
        goat.gameObject.SetActive(true);
        goat.position            = new Vector3(-11f, -2.8f, 0f);
        goatSprite.localPosition = Vector3.zero;
        goat.DOMoveX(11f, 5f).SetLoops(-1, LoopType.Restart).SetEase(Ease.Linear);
        goatSprite.DOLocalMoveY(.2f, 0.2f).SetRelative(true).SetLoops(-1, LoopType.Yoyo);
    }