Пример #1
0
 /// <summary>
 /// Check a raycast hit, and call appropriate event handlers
 /// </summary>
 /// <param name="hurtbox"></param>
 /// <param name="dHealth"></param>
 /// <param name="hit"></param>
 /// <param name="OnHit"></param>
 private static void ApplyCastHit(Hurtbox hurtbox, DeltaHealth dHealth, RaycastHit hit, Action <Hurtbox, RaycastHit> OnHit)
 {
     if (dHealth != null && hurtbox != null)
     {
         hurtbox.ApplyDeltaHealth(dHealth);
     }
     OnHit?.Invoke(hurtbox, hit);
 }
Пример #2
0
        private void OnTriggerEnter(Collider other)
        {
            Hurtbox hurtbox = other.GetComponent <Hurtbox>();

            hurtbox?.ApplyDeltaHealth(dHealth);
        }