예제 #1
0
    public void ButtonDoneNewPlayer()
    {
        bool valid = true;

        if (inputName.text == string.Empty)
        {
            imageConfirmationName.sprite = spriteError;
            valid = false;
        }
        else
        {
            imageConfirmationName.sprite = spriteCheck;
        }

        if (inputNumber.text == string.Empty)
        {
            imageConfirmationNumber.sprite = spriteError;
            valid = false;
        }
        else
        {
            imageConfirmationNumber.sprite = spriteCheck;
        }

        if (!valid)
        {
            return;
        }

        Player     p  = new Player(int.Parse(inputNumber.text), inputName.text);
        ItemPlayer ip = Instantiate(prefabItemPlayer, parentItemPlayers).GetComponent <ItemPlayer>();

        ip.StartThis(p);
        SF.AddPlayer(p);
        MUI.GoRight(myAnimator);
    }