Exemple #1
0
    private IEnumerator OnPickup(Chara c)
    {
        GetComponent <Collider2D>().enabled = false;
        icon_text.gameObject.SetActive(false);

        // User
        user               = c;
        user.on_pickup    += OnUserPickupNew;
        user.on_use_power += Respawn;

        // Name text
        string key_name = InputExt.GetControlName(c.PlayerID, Control.Action);

        name_text.text = power.ToString();
        if (key_name != "")
        {
            name_text.text += " [" + key_name + "]";
        }

        for (int i = 0; i < 5; ++i)
        {
            name_text.gameObject.SetActive(i % 2 == 0);
            yield return(new WaitForSeconds(0.1f));
        }
        yield return(new WaitForSeconds(0.3f));

        name_text.gameObject.SetActive(false);
    }
Exemple #2
0
    public void ShowTagScreen(Chara winner, int[] scores)
    {
        GameManager gm     = GameManager.Instance;
        Chara       chaser = gm.GetChaser();
        Chara       runner = gm.GetRunner();

        gm.HideCourt();

        tag_screen.gameObject.SetActive(true);
        tag_text.color = chaser.PlayerColor;

        // Score
        score_left.color  = chaser.PlayerID == 0 ? chaser.PlayerColor : Color.white;
        score_right.color = chaser.PlayerID == 1 ? chaser.PlayerColor : Color.white;
        score_left.text   = gm.GetScores()[0].ToString();
        score_right.text  = gm.GetScores()[1].ToString();

        // Continue text
        tag_continue_text.color = winner.PlayerColor;
        string control = InputExt.GetControlName(winner.PlayerID, Control.Action);

        if (control != "")
        {
            tag_continue_text.text = "press " + control;
        }
        else
        {
            tag_continue_text.text = "";
        }
    }