private IEnumerator Resolve() { GameObject box = new GameObject(); AudioSource audioSource = Camera.main.GetComponent <AudioSource>(); foreach (GameObject disposable in Disposables) { Health health = disposable.GetComponent <Health>(); if ((disposable.CompareTag("Enemy") || disposable.CompareTag("Friend")) && health != null && health.CurrentHealth.Value <= 0) { audioSource.PlayOneShot(Resources.Load <AudioClip>("SFX/S_Explo02")); GameObject explo = Instantiate(ManagedPrefabs.Bank[PrefabID.Explo01]); explo.transform.position = disposable.transform.position; explo.transform.DOPunchScale(Vector3.one * 3, 1f, 2, 0f).OnComplete(() => explo.Destroy()); } disposable.transform.SetParent(box.transform); } Destroy(box); Disposables.Clear(); CurrentPhase.Value = Phase.AiMove; yield return(null); }
public void Dispose() { foreach (var d in Disposables) { d?.Dispose(); } Disposables.Clear(); }
protected virtual void DisposeCore() { foreach (var disposable in Disposables) { disposable?.Dispose(); } Disposables.Clear(); Disposables = null; }
public override void UnSubscribeModel() { Disposables.Clear(); }
public void DetachView() { _viewRef = null; Disposables.Clear(); Disposables.Dispose(); }
protected virtual void DisposeInternals() { Disposables.Clear(); CloseQuery = null; }