コード例 #1
0
		void EnableTrailRenderer(CountdownTimer t)
		{
			if(toDisable.Count > 0)
			{
				toDisable.Dequeue().Clear();
			}
		}
コード例 #2
0
        private void ResawnHelper(CountdownTimer t)
        {
            // Find the dead player again
            Controller deadPlayer = controllers.Find(x => x.ID.Equals(System.Enum.Parse(typeof(PlayerID), t.ID)));
            //RespawnNode playerNode = respawnNodes.Find(x => x.ID.Equals(System.Enum.Parse(typeof(PlayerID), t.ID)));
            RespawnNode playerNode = respawnNodes[Random.Range(0, respawnNodes.Count)];
            if (deadPlayer != null)
            {
                deadPlayer.transform.position = playerNode.transform.position;
                // Let the player revive itself
                if (currentGame.GetType().Equals(typeof(MeleeMinigame))) deadPlayer.LifeComponent.Respawn(false);
				else if (currentGame.GetType().Equals(typeof(CaymanGame))) deadPlayer.LifeComponent.Respawn(false);
                else deadPlayer.LifeComponent.Respawn();
            }
        }
コード例 #3
0
ファイル: GameManager.cs プロジェクト: AmbroseC/Rangers
 /// <summary>
 /// Target for the respawn timer to run on timeout.
 /// </summary>
 /// <param name="t">The timer that is firing the event</param>
 private void ResawnHelper(CountdownTimer t)
 {
     // Find the dead player again
     Controller deadPlayer = controllers.Find(x => x.ID.Equals(System.Enum.Parse(typeof(PlayerID), t.ID)));
     if (deadPlayer != null)
     {
         // Find an appropriate spawning pod (set to default for now)
         deadPlayer.transform.position = Vector3.zero;
         // Let the player revive itself
         deadPlayer.LifeComponent.Respawn();
     }
 }
コード例 #4
0
ファイル: GameManager.cs プロジェクト: AmbroseC/Rangers
 /// <summary>
 /// Timer that will end the match
 /// </summary>
 /// <param name="t">The timer that timed out</param>
 private void TimeUp(CountdownTimer t)
 {
     Debug.Log("Time is up");
 }
コード例 #5
0
ファイル: GameManager.cs プロジェクト: dvalles/Rangers
 /// <summary>
 /// Resets the scene.
 /// </summary>
 private void ResetLevel(CountdownTimer t)
 {
     SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
 }
コード例 #6
0
		private void GoToMatchSummary(CountdownTimer t)
		{
			GameObject g = new GameObject("MatchSummaryManager");
			MatchSummaryManager summary = g.AddComponent<MatchSummaryManager>();
			DontDestroyOnLoad(g);
			MatchSummaryManager.winner = currentWinner;
			MatchSummaryManager.playerInfo = new Dictionary<PlayerID, int>();
			if(currentGameSettings.Type == Enums.GameType.Deathmatch) {
				for(int i = 0; i < controllers.Count; i++) {
					MatchSummaryManager.playerInfo.Add(controllers[i].ID,controllers[i].LifeComponent.kills);
				}
			} else {
				for(int i = 0; i < controllers.Count; i++) {
					MatchSummaryManager.playerInfo.Add(controllers[i].ID,(int)controllers[i].LifeComponent.Lives);
				}
			}
			SceneManager.LoadScene("MatchSummary", LoadSceneMode.Single);
		}
コード例 #7
0
        /// <summary>
        /// Timer that will end the match
        /// </summary>
        /// <param name="t">The timer that timed out</param>
        private void TimeUp(CountdownTimer t)
        {
			GameOver();
        }