void OnWin(NetworkMessage netMsg)
    {
        WinMessage msg = netMsg.ReadMessage <WinMessage>();

        if (msg.win)
        {
            TextAnnouncer announcer = GameObject.Find("Canvas").GetComponent <Canvas>().GetComponent <TextAnnouncer>();
            Invoke("Restart", announcer.displayTime);
            announcer.Display(msg.toDisplay);
        }
    }
Exemple #2
0
    void OnWin(NetworkMessage netMsg)
    {
        WinMessage msg = netMsg.ReadMessage <WinMessage>();

        if (msg.win)
        {
            TextAnnouncer announcer = GameObject.Find("Canvas").GetComponent <Canvas>().GetComponent <TextAnnouncer>();
            GameObject.FindGameObjectWithTag("SoundManager").GetComponent <SoundManager>().Play("win");
            float displayTime = GameObject.FindGameObjectWithTag("SoundManager").GetComponent <SoundManager>().GetSound("win").clip.length;
            Invoke("Restart", displayTime);
            announcer.DisplayWithTime(msg.toDisplay, displayTime);
        }
    }