예제 #1
0
 public void CharacterDeath(int characterId)
 {
     _paused = true;
     if (characterId == 1)
     {
         LeftCharInfo.CharacterDeath();
         StartCoroutine(ResetCharactersRoutine());
     }
     else
     {
         RightCharInfo.CharacterDeath();
         StartCoroutine(ResetCharactersRoutine());
     }
 }
예제 #2
0
        private void FixedUpdate()
        {
            if (!_paused)
            {
                LeftCharInfo.Move(RightCharInfo, _moveSpeed, _walkForwardForce);
                RightCharInfo.Move(LeftCharInfo, _moveSpeed, _walkForwardForce);

                if (LeftCharInfo.Go.transform.position.y < -60f)
                {
                    PlayerDeathEvent.Raise(1);
                    CharacterDeath(1);
                }
                else if (RightCharInfo.Go.transform.position.y < -60f)
                {
                    PlayerDeathEvent.Raise(2);
                    CharacterDeath(2);
                }
            }
        }
예제 #3
0
 public void ResetCharacters()
 {
     LeftCharInfo.CharacterRevive(LeftCurrentSpawnPoint);
     RightCharInfo.CharacterRevive(RightCurrentSpawnPoint);
 }