// 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 (_indicateObj) { _indicateObj.Destroy(); _indicateObj = null; } if (_explodeObj) { _explodeObj.Destroy(); _explodeObj = null; } _isPlaying = false; DespawnParamObject(); }
// interfac methods // public override void PlayAndDestroy() { if (_factory.IsNull()) { DespawnParamObject(); return; } if (_isPlaying) { return; } if (!_factory.RangeIndicator.IsNull()) { _indicateObj = _factory.RangeIndicator.Create(transform); _indicateObj.Show(); } Invoke("_DoFadeout", _factory.DelayOfFadeout); Invoke("_DoExplode", _factory.DelayOfExploding); }
// process methods // protected override void OnEnable() { _indicateObj = null; }