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); } }
private void OnHitDelegate(HitEffectList effects, Target target) { if (!this.targetable_OnHit) { return; } MessageData_TargetableOnHit arg = new MessageData_TargetableOnHit(effects, target); this.handleMsg <MessageData_TargetableOnHit>("Targetable_OnHit", arg); }
public HitEffectList CopyWithHitTime() { HitEffectList newlist = new HitEffectList(); base.ForEach(delegate(HitEffect effect) { effect.hitTime = Time.time; newlist.Add(effect); }); return(newlist); }
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); } }
/// <summary> /// Get a copy of this list with effects hitTime set to 'now'. /// </summary> /// <returns>HitEffectList</returns> public HitEffectList CopyWithHitTime() { var newlist = new HitEffectList(); HitEffect effect; IEnumerator <HitEffect> enumerator = base.GetEnumerator(); while (enumerator.MoveNext()) { effect = enumerator.Current; effect.hitTime = Time.time; newlist.Add(effect); } return(newlist); }
/// <summary> /// Triggered when a target is hit /// </summary> /// <param name="source">The HitEffectList to send</param> /// <param name="source"> /// The target struct used to cache this target when sent /// </param> public void OnHit(HitEffectList effects, Target target) { this.OnHit(effects, target, null); }
public HitEffectList(HitEffectList hitEffectList) : base(hitEffectList) { }
public MessageData_TargetableOnHit(HitEffectList effects, Target target) { this.effects = effects; this.target = target; }