void OnTriggerEnter2D(Collider2D other) { if (bubble == null) { bubble = GetComponentInParent <SpecialBubbleUnit> (); } if (other.CompareTag("Bubble")) { BubbleUnit otherBubble = other.GetComponent <BubbleUnit>(); if (otherBubble != null) { bubble.DealEffectCleanBubble(otherBubble); } } }
void OnEnable() { bubble = GetComponentInParent <SpecialBubbleUnit> (); }