private void OnTriggerEnter(Collider other) { if (other.CompareTag("ElevatorDoor")) { if (!_insideTheElevator) { if (_elevator.IsStopedOnTheFloor(_currentFloor.Index) && _elevator.HasRoom) { HandleInsideElevator(); StopMovement(); } else { _ragDoll = true; AudioManager.instance.Play("Fall"); OnUserDied?.Invoke(); } } } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("ElevatorDoor")) { if (!_insideTheElevator && (_elevator.IsStopedOnTheFloor(_currentFloor.Index)) && _elevator.HasRoom) { StopMovement(); _animator.Idle(); HandleInsideElevator(); } else { _ragDoll = true; AudioManager.instance.Play("Fall"); OnUserDied?.Invoke(); } } // return; /* * if (other.CompareTag("ElevatorDoor")) * { * if (!_insideTheElevator && !_moveToDespawn) * { * if (_elevator.IsStopedOnTheFloor(_currentFloor.Index) && _elevator.HasRoom) * { * HandleInsideElevator(); * StopMovement(); * } * else * { * _ragDoll = true; * AudioManager.instance.Play("Fall"); * OnUserDied?.Invoke(); * } * } * }*/ }