Ejemplo n.º 1
0
    public void OnCheckDance(SocketIOEvent e)
    {
        checkDanceobject a = checkDanceobject.createFromJson(e.data.ToString());

        for (int i = 0; i < a.player1_dance.Count(); i++)
        {
            int x = a.player1_dance[i];
            players[pos[0]].GetComponent <movetMentController>().setDance(x);

            x = a.player2_dance[i];
            players[pos[1]].GetComponent <movetMentController>().setDance(x);
        }
        if (a.isEnd == true)
        {
            test.text = "Game is End";

            if (isLead())
            {
                playerTexts [playerPos].text   = "Winner";
                playerTexts [opponentPos].text = "Loser";
                players[playerPos].GetComponent <movetMentController>().setDance(5);
                players[opponentPos].GetComponent <movetMentController>().setDance(6);
            }
            else
            {
                playerTexts [playerPos].text   = "Loser";
                playerTexts [opponentPos].text = "Winner";
                players[playerPos].GetComponent <movetMentController>().setDance(6);
                players[opponentPos].GetComponent <movetMentController>().setDance(5);
            }

            this.GetComponent <AudioController>().playEnd();
        }
        else
        {
            endTurn();
        }
    }
Ejemplo n.º 2
0
    public static checkDanceobject createFromJson(string json)
    {
        checkDanceobject info = JsonUtility.FromJson <checkDanceobject>(json);

        return(info);
    }