Пример #1
0
    public void CharacterSelected()
    {
        ChangeCharacter();
        menuAnimator.Play("CharacterSelectedAnimation", 0, 0f);
        PlayCharacterSelectAudio();

        GameObject[] selectionContainers = GameObject.FindGameObjectsWithTag("CharacterSelectionContainer");
        for (int i = 0; i < selectionContainers.Length; i++)
        {
            GameObject cont = selectionContainers[i];
            if (cont.GetComponentInChildren <Button>().gameObject == EventSystem.current.currentSelectedGameObject)
            {
                if ((int)highlightedCharacter != i)
                {
                    // todo: do something nice
                }
            }
            else
            {
                // todo: undo the niceness
            }
        }

        SNBGlobal.thisUser.character = highlightedCharacter;
        if (currentMatch != null)
        {
            currentMatch.PlayerReady();
        }
    }