Example #1
0
 void Update()
 {
     if (Time.time > _next)
     {
         Debug.Log($"Transform {transform}");
         StartCoroutine(weapon.Activate(FacingTransform, Time.time + weapon.spawnDelay));
         _next = Time.time + delay;
     }
 }
Example #2
0
 public void Trigger()
 {
     if (!_controller.locked && Time.time > _nextTime)
     {
         StartCoroutine(TriggerCoroutine());
         _nextTime = Time.time + _controller.spawnDelay;
         StartCoroutine(_controller.Activate(playerPos, _nextTime));
         if (_audioSource.enabled)
         {
             _audioSource.Play();
         }
     }
 }