Example #1
0
        public void OnHit(HitEffectList effects, Target target, Collider other)
        {
#if UNITY_EDITOR
            // Normal level debug and above
            if (this.debugLevel > DEBUG_LEVELS.Off)
            {
                Debug.Log
                (
                    string.Format
                    (
                        "Targetable ({0}): HitEffects[{1}]",
                        this.name,
                        effects.ToString()
                    )
                );
            }
#endif

            // Set the hitTime for all effects in the list.
            effects = effects.CopyWithHitTime();

            if (this.onHitDelegates != null)
            {
                this.onHitDelegates(effects, target);
            }

            // Same as above with addition of collider in signature
            if (this.onHitColliderDelegates != null)
            {
                this.onHitColliderDelegates(effects, target, other);
            }
        }
Example #2
0
 public void OnHit(HitEffectList effects, Target target, Collider other)
 {
     effects = effects.CopyWithHitTime();
     if (this.onHitDelegates != null)
     {
         this.onHitDelegates(effects, target);
     }
     if (this.onHitColliderDelegates != null)
     {
         this.onHitColliderDelegates(effects, target, other);
     }
 }