Example #1
0
 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>());
     }
 }
Example #2
0
        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()!");
            }
        }
Example #3
0
 public void OnOverlappedDisabled(GameObject other)
 {
     OverlappingMergeTriggers.Remove(other.gameObject.GetComponent <MergableObject>());
 }