void HitAgent(RTSAgent agent) { if (this.UseEffects && this.AttachEndEffectToTarget) { LSEffect lSEffect = EffectManager.CreateEffect(this.HitFX); lSEffect.CachedTransform.parent = agent.VisualCenter; lSEffect.CachedTransform.localPosition = Vector3.up; lSEffect.CachedTransform.rotation = this.cachedTransform.rotation; lSEffect.Initialize(); } this.HitEffect(agent); if (onHitAgent != null) { onHitAgent(agent); } }
private void Hit(bool destroy = true) { this.OnHit(); if (this.onHit.IsNotNull()) { this.onHit(); } if (this.TargetCurrent) { if (this.UseEffects) { if (this.AttachEndEffectToTarget) { LSEffect lSEffect = EffectManager.CreateEffect(this.HitFX); lSEffect.CachedTransform.parent = this.Target.VisualCenter; lSEffect.CachedTransform.localPosition = Vector3.up; lSEffect.CachedTransform.rotation = this.cachedTransform.rotation; lSEffect.Initialize(); } else { //Certain targeting types collide with a target if (this.TargetingBehavior == TargetingType.Homing) { EffectManager.CreateCollisionEffect(this.HitFX, this, Target.Body); } else { EffectManager.CreateEffect(this.HitFX, this.cachedTransform.position, this.cachedTransform.rotation); } } } } if (destroy) { ProjectileManager.EndProjectile(this); } }
public static void Fire(LSEffect effect) { effect.Initialize(); }