public void OnTriggerExit(Collider other) { if (other.gameObject.CompareTag("ShapeMergeRadius")) { GameObject otherShape = other.gameObject.transform.parent.gameObject; otherShape.GetComponent <NotifyOnDisable>().OnObjectDisabled += OnOverlappedDisabled; OverlappingMergeTriggers.Remove(otherShape.GetComponent <MergableObject>()); } }
void OnDisable() { OverlappingMergeTriggers.Clear(); targetedByAgent = false; if (_all.Contains(this)) { _all.Remove(this); } if (_allBySize.ContainsKey(Size) && _allBySize[Size].Contains(this)) { _allBySize[Size].Remove(this); } Game.GameManager.Instance?.OnObjectRemoved(this.gameObject); if (_didWatchPositionCheck) { _HasMovedFromScenePosition = true; } else { Debug.LogWarning("Shape called OnDisable before calling Start()!"); } }
public void OnOverlappedDisabled(GameObject other) { OverlappingMergeTriggers.Remove(other.gameObject.GetComponent <MergableObject>()); }