Esempio n. 1
0
 void SendAllPrepareVote()
 {
     //VoteMessage msg = new VoteMessage();
     //msg.serverSpeaking = true;
     //msg.start = false;
     //msg.choice = -1;
     //clientsReady = new HashSet<int>();
     //waitingToBeReady = true;
     //server.SendMessageToAllClients(VoteMessage.id, msg);
     socketClient.ChangeVoteStatus(true);
     StartVote();
 }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        choices = new Image[4];
        scores  = new Text[4];
        for (int i = 0; i < 4; i++)
        {
            choices[i] = GameObject.Find("Choice" + (i + 1).ToString()).GetComponent <Image>();
            scores[i]  = GameObject.Find("Score" + (i + 1).ToString()).GetComponent <Text>();
        }
        monster = new Image[5];
        monster[(int)VoteType.MOUTH] = GameObject.Find("Mouth").GetComponent <Image>();
        monster[(int)VoteType.EYES]  = GameObject.Find("Eyes").GetComponent <Image>();
        monster[(int)VoteType.HAT]   = GameObject.Find("Hat").GetComponent <Image>();
        monster[(int)VoteType.ARMS]  = GameObject.Find("Arms").GetComponent <Image>();
        monster[4]        = GameObject.Find("Body").GetComponent <Image>();
        monster[4].sprite = bodies[2];
        monster[4].color  = Color.white;

        voteText = GameObject.Find("VoteTime").GetComponent <Text>();
        time     = GameObject.Find("Time").GetComponent <Text>();
        //server = GameObject.Find("Server").GetComponent<Server>();
        //server.SetupServer();
        socketClient = SocketClient.GetInstance();
        socketClient.voteEventCallbacks += onVoteMessageReceived;
        socketClient.ChangeMode(0);
        socketClient.ChangeVoteStatus(false);
    }