Exemplo n.º 1
0
    private static void NumberInputProcessed(bool del)
    {
        GameObject            player = GameObject.Find("LOCAL Player");
        NetworkedPlayerScript nps    = player.GetComponent <NetworkedPlayerScript>();

        bool shouldClear = true;

        if (numberTextField.text != null)
        {
            int input = -1;
            if (System.Int32.TryParse(numberTextField.text, out input))
            {
                if (nps.GetColor() != input)
                {
                    if (nps.DoesPlayerNumberExist(input) != -1)
                    {
                        GUIManagerScript.SetNumberInputFieldColor(ColorScript.GetColor(input), true);
                        shouldClear = false;
                    }
                }
            }
        }

        if (shouldClear)
        {
            Color clr = ColorScript.GetColor(nps.GetColor());
            clr = clr * 0.5f;
            GUIManagerScript.SetNumberInputFieldColor(clr);

            if (del)
            {
                GUIManagerScript.ClearNumberInput();
            }
        }
    }
Exemplo n.º 2
0
    public void RpcCountdown(bool l)
    {
        GUIManagerScript.SetEndGameScreen(false);
        if (l)
        {
            //playerParent.GetComponent<PlayerParentScript>().LockAndSpin();
            AudioManagerScript.instance.PrepareGameMusic();
            AudioManagerScript.instance.PlayCountdown();
            GUIManagerScript.SetRulesButton(false);
            GUIManagerScript.SetInput(false);
        }
        else
        {
            //playerParent.GetComponent<PlayerParentScript>().Unlock();
            Debug.Log("Countdown stopped!");
            AudioManagerScript.instance.StopSFX();
            AudioManagerScript.instance.StartMenuMusic();
            GUIManagerScript.SetRulesButton(true);
            GUIManagerScript.SetInput(true);

            if (networkedPScript == null)
            {
                SetNPS();
            }
            if (networkedPScript.nameText == ColorScript.GetColorName(networkedPScript.GetColor()))
            {
                networkedPScript.nameText = "";
                GUIManagerScript.FillPlayerText("");
            }
        }
    }