private void PoppedHandler(Bubble bubble) { RemoveListeners(); gameObject.layer = (int)Layers.IgnoreRayCast; BubbleDeath.KillBubble(gameObject, BubbleDeathType.Pop); }
private IEnumerator CullAfterFallingDistance(float distance) { var total = 0.0f; var myTransform = transform; var lastPosition = myTransform.localPosition; while (total < distance) { var position = myTransform.localPosition; if (position.y < lastPosition.y) { gameObject.layer = (int)Layers.FallingObjects; total += (position - lastPosition).magnitude; } lastPosition = position; yield return(null); } BubbleDeath.KillBubble(gameObject, BubbleDeathType.Cull); }
override protected void CullBubble(Bubble bubble) { BubbleDeath.KillBubble(gameObject, BubbleDeathType.Cull); }
protected void OnTriggerEnter2D(Collider2D collider) { BubbleDeath.KillBubble(collider.gameObject, BubbleDeathType.Cull); }