Beispiel #1
0
 //Called when the server is started
 public override void OnStartServer()
 {
     if (isServer)
     {
         if (!WinBarSingleton.peekInstance())
         {
             this.CmdSpawnWinBar();
         }
         NetworkServer.RegisterHandler(7999, OnReceiveEndGameMessage);
         NetworkServer.RegisterHandler(7998, OnReceiveSlowMessage);
     }
 }
Beispiel #2
0
 public void CmdReceiveEndGameMessage(bool endCond)
 {
     if (!this.EndFlag)
     {
         WinBarSingleton.resetInstance();
         if (endCond)
         {
             Instantiate(this.gameWinUI);
         }
         else
         {
             Instantiate(this.gameOverUI);
         }
         this.EndFlag = true;
     }
 }
Beispiel #3
0
 public void CmdSpawnWinBar()
 {
     this.localWinBar = Instantiate(WinBarSingleton.getInstance(winBar));
     this.localWinBar.transform.position = new Vector3(0, 9, 0);
     NetworkServer.Spawn(this.localWinBar);
 }