Exemplo n.º 1
0
 public void Reload()
 {
     if (!CanReload())
     {
         return;
     }
     StartCoroutine(_startReloadingCoroutine());
     reloadCue.Execute(transform.position, Quaternion.identity);
 }
Exemplo n.º 2
0
 private void RPC_TakeDamage()
 {
     Animator.TakeDamage();
     if (photonView.IsMine)
     {
         var transformCached = transform;
         playerDamagedCue.Execute(transformCached.position, transformCached.rotation);
     }
 }
Exemplo n.º 3
0
 private void OnTriggerEnter(Collider other)
 {
     if (1 << other.gameObject.layer == obstacleLayer)
     {
         if (_colliders.Count == 0)
         {
             phasingCue.Execute(transform.position, Quaternion.identity);
         }
         _colliders.Add(other);
     }
 }
Exemplo n.º 4
0
        public void Shoot()
        {
            var now = Time.time;

            if (!CanShoot(now))
            {
                return;
            }
            _lastShoot        = now;
            _currentClipAmmo -= 1;
            OnAmmoChange?.Invoke(_currentClipAmmo);
            var shootingPosition = ShootingPoints[_currentShootingPoint].Transform.position;

            photonView.RPC(nameof(RPC_SpawnBullet), RpcTarget.MasterClient,
                           PhotonNetwork.LocalPlayer.UserId,
                           addForceVelocity,
                           PhotonNetwork.LocalPlayer.GetPlayerNumber(),
                           shootingPosition,
                           GetShootingDirection()
                           );
            shootCue.Execute(shootingPosition, Quaternion.identity);
            _currentShootingPoint = (_currentShootingPoint + 1) % ShootingPoints.Length;
        }
Exemplo n.º 5
0
 private void ExecuteCueAndWaitToFinish(float time)
 {
     countdownCue.Execute(transform.position, Quaternion.identity);
     _waitSeconds.Wait(time);
 }
Exemplo n.º 6
0
 private void ExecuteCue()
 {
     cue.Execute(transform.position, Quaternion.identity);
 }