Пример #1
0
    public void PlayCard()
    {
        RectTransform myRectTransform = GetComponent <RectTransform>();

        if (CdField.childCount < 5)
        {
            transform.SetParent(CdField);
            TurnsManager.instance.EndPickPhase(myRectTransform);
            if (GamesManager.GetGameMode() == Enumerations.GameModes.Online && TurnsManager.instance.IsCurrentPlayerA())
            {
                string staticId      = myRectTransform.Find("CardStaticID").GetComponent <UnityEngine.UI.Text>().text;
                string serverMessage = "cardPlayed|" + staticId;
                ServerGameBehavior.SendMessage(serverMessage);
            }
        }
    }
Пример #2
0
    public void EndGame(char winner, char loser)
    {
        BasePlayer aPlayer = TurnsManager.instance.aPlayer;
        BasePlayer bPlayer = TurnsManager.instance.bPlayer;

        if (char.ToLower(winner) == 'a')
        {
            EndGame(aPlayer, bPlayer);
        }
        else
        {
            EndGame(bPlayer, aPlayer);
        }
        if (GamesManager.GetGameMode() == Enumerations.GameModes.Online)
        {
            Destroy(TurnsManager.instance);
        }
    }