示例#1
0
 private void Update()
 {
     if (Player1TimeUp && Player2TimeUp)
     {
         m_Winner        = m_Player1.TotalScore > m_Player2.TotalScore ? m_Player1.PlayerIndexValue : m_Player2.PlayerIndexValue;
         m_GameOver.text = "Game Over.  " + m_Winner.ToString() + " Won. " + "Press E to Restart";
         Time.timeScale  = 0;
         if (Input.GetKeyDown(KeyCode.E))
         {
             Time.timeScale = 1;
             SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
         }
     }
 }
示例#2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.GetComponent <PlayerController>())
     {
         m_OwnerPlayerController = other.GetComponent <PlayerController>();
         m_PlayerInZone.Add(m_OwnerPlayerController.PlayerIndexValue);
         m_OwnerPlayerIndex = m_OwnerPlayerController.PlayerIndexValue;
     }
     if (other.GetComponent <ChoppingBoard>())
     {
         m_ChoppingBoardOwner = other.GetComponent <ChoppingBoard>();
         if (!m_PlayerInZone.Contains(m_OwnerPlayerIndex))
         {
             m_PlayerInZone.Add(m_OwnerPlayerIndex);
         }
     }
 }