Beispiel #1
0
 public void ButtonStartGame()
 {
     if (plantel.Count > 0)
     {
         MUI.GoRight(panelPlaying);
     }
 }
Beispiel #2
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);
    }
Beispiel #3
0
    public void OpenMatch(ItemMatch _itemMatch)
    {
        currentItemMatch    = _itemMatch;
        textMatchTitle.text = _itemMatch.GetMatch().date.ToShortDateString();

        //GENERAL
        textDuration.text   = _itemMatch.GetMatch().duration.Minutes.ToString("00") + ":" + _itemMatch.GetMatch().duration.Seconds.ToString("00");
        textGoalsAlly.text  = _itemMatch.GetMatch().GetNGoalsAlly().ToString();
        textGoalsEnemy.text = _itemMatch.GetMatch().GetNGoalsEnemy().ToString();
        textFouls.text      = _itemMatch.GetMatch().GetNFouls().ToString();
        textYellows.text    = _itemMatch.GetMatch().GetNYellows().ToString();
        textReds.text       = _itemMatch.GetMatch().GetNReds().ToString();

        //EVENTS
        for (int i = 0; i < parentItemEvents.childCount; i++)
        {
            Destroy(parentItemEvents.GetChild(i).gameObject);
        }

        for (int i = 0; i < _itemMatch.GetMatch().events.Count; i++)
        {
            ItemEvent ie = Instantiate(prefabItemEvent, parentItemEvents);
            ie.StartThis(_itemMatch.GetMatch().events[i]);
        }

        //PLAYERS
        for (int i = 0; i < parentItemPlayers.childCount; i++)
        {
            Destroy(parentItemPlayers.GetChild(i).gameObject);
        }

        for (int i = 0; i < _itemMatch.GetMatch().GetNPlayers(); i++)
        {
            ItemPlayerHistory ie = Instantiate(prefabItemPlayer, parentItemPlayers);
            ie.StartThis(_itemMatch.GetMatch().GetPlayer(i));
        }

        ButtonGeneral();

        MUI.GoRight(panelMatchProfile);
    }