void OnFree() { if (_freeNotifiable) { LifeCycleBus.Notify(gameObject); } }
void Awake() { LifeCycleBus.Subscribe(TagName.Enemy, enemy => { var exp = ObjectPool.Alloc(_explosionVFX); exp.transform.position = enemy.transform.position; ObjectPool.Free(exp, 1f); GlobalAudioSource.PlayOneShot(_explosionSE); ScoreManager.AddScore(_scoreByEnemy); }); }
void OnDestroy() { LifeCycleBus.Clean(); }