private void OnOutputComplete() { explodeEffObj = null; // 放它自生自灭 groundEffObj = null; isPlaying = false; PoolManager.Despawn(xform); }
void OnEnable() { if (!EffectParams.IsNull()) { effectObj = EffectParams.Create(transform); } effectObj.PlayAndDestroy(); }
// private void _DoExplode() { if (!_factory.Explosion.IsNull()) { ExplosionParamObject bomb = (ExplosionParamObject) _factory.Explosion.Create(transform.position); bomb.AdditionalHitResult = AdditionalHitResult; bomb.Owner = gameObject; bomb.PlayAndDestroy(); } _indicateObj = null; _explodeObj = null; _isPlaying = false; DespawnParamObject(); }
public override void Destroy() { CancelInvoke(); if (explodeEffObj) { explodeEffObj.Destroy(); explodeEffObj = null; } if (groundEffObj) { groundEffObj.Destroy(); groundEffObj = null; } isPlaying = false; PoolManager.Despawn(xform); }
// public override void Destroy() { CancelInvoke(); if (_indicateObj) { _indicateObj.Destroy(); _indicateObj = null; } if (_explodeObj) { _explodeObj.Destroy(); _explodeObj = null; } _isPlaying = false; DespawnParamObject(); }
private void Explode() { if (!factory.ExplodeEffect.IsNull()) { explodeEffObj = factory.ExplodeEffect.Create(xform.position); explodeEffObj.PlayAndDestroy(); } if (!factory.GroundEffect.IsNull()) { Vector3 groundPoint = ExplosionParamSettings.Params.Agent.GetGroundEffectPosition(xform.position); if (xform.position.y - groundPoint.y <= factory.MaxHeightToShowGroundEffect) { groundEffObj = factory.GroundEffect.Create(groundPoint); groundEffObj.PlayAndDestroy(); } } if (factory.EnergyOutput != null) { factory.EnergyOutput.Send(Sender, this, xform.position, OnOutputComplete); } }