public void UpdateFixtures() { if (Fixtures.Count > 0) { for (var i = Fixtures.Count - 1; i >= 0; i--) { var fixture = Fixtures[i]; if (FixtureIsConnected(fixture) == false) { Fixtures.RemoveAt(i); } } if (Fixtures.Count == 0) { if (OnAllFixturesRemoved != null) { OnAllFixturesRemoved.Invoke(); } if (AutoDestroy == true) { DestroyableHelper.Destroy(this); } } } }
private void Sweep() { while (tempColliders.Count > 0) { DestroyableHelper.Destroy(tempColliders.Pop()); } }
protected virtual void OnDisable() { destructible.OnAlphaDataReplaced.RemoveListener(OnAlphaDataReplaced); destructible.OnAlphaDataModified.RemoveListener(OnAlphaDataModified); destructible.OnAlphaDataSubset.RemoveListener(OnAlphaDataSubset); destructible.OnStartSplit.RemoveListener(OnStartSplit); destructible.OnEndSplit.RemoveListener(OnEndSplit); if (child != null) { child.SetActive(false); } if (destructible.IsOnStartSplit == true) { if (child != null) { child.transform.SetParent(null, false); child = DestroyableHelper.Destroy(child); } if (tempChild != null) { tempChild = DestroyableHelper.Destroy(tempChild); } } }
public void DestroyChild() { if (child != null) { child = DestroyableHelper.Destroy(child); } }
protected virtual void Awake() { if (this.GetComponent <Collider2D>() != null) { var collider2Ds = this.GetComponents <Collider2D>(); for (var i = collider2Ds.Length - 1; i >= 0; i--) { DestroyableHelper.Destroy(collider2Ds[i]); } } }
private void DestroyFixture() { DestroyableHelper.Destroy(gameObject); }