public void DestroyWithoutScore() { lockOn.RemoveMe(transform); OnDestroyWithoutScore.Invoke(); if (!Addressables.ReleaseInstance(this.gameObject)) { Destroy(gameObject); } }
void Start() { enemys = GetComponent <BezierSolution.BezierWalkerLocomotion>().Tail.Select(x => x.GetComponent <SnakeSlave>()).ToList(); foreach (SnakeSlave s in enemys) { s.transform.parent = transform; } OnDestroyWithScore.AddListener(MultiEnemyDestroyWithScore); OnDestroyWithoutScore.AddListener(MultiEnemyDestroyWithoutScore); }
public void DestroyWithoutScore() { lockOn.RemoveMe(transform); OnDestroyWithoutScore.Invoke(); StartCoroutine(this.DelayMethod(1f, () => { if (!Addressables.ReleaseInstance(this.gameObject)) { Destroy(gameObject); } })); }
void Start() { OnDestroyWithScore.AddListener(EnemyDestroyWithScore); OnDestroyWithoutScore.AddListener(EnemyDestroyWithoutScore); }