void OnTriggerEnter2D(Collider2D coll) { if (coll.gameObject.GetComponent <BarrierController>() && coll.gameObject.GetComponent <BarrierController>().isSpicky) { bubble.BrokenOut(); } else if (coll.gameObject.GetComponent <BarrierController>()) { Stop(); } else if (coll.gameObject.GetComponent <RubbishController>()) { RubbishController sampahController = coll.gameObject.GetComponent <RubbishController>(); if (bubble.CanLift(sampahController) && !bubble.thrownRubbishes.Contains(sampahController)) { bubble.LiftRubbish(sampahController); } else if (bubble.CanLiftWithThrowFirst(sampahController) && !bubble.thrownRubbishes.Contains(sampahController)) { bubble.ThrowFirstRubbish(); bubble.LiftRubbish(sampahController); } else { Stop(); Physics2D.IgnoreCollision(bubble.realCollider, coll); } } }
void OnTriggerEnter2D(Collider2D coll) { if (coll.gameObject.GetComponent <BarrierController>() && coll.gameObject.GetComponent <BarrierController>().isSpicky) { bubble.BrokenOut(); } else if (coll.gameObject.GetComponent <BarrierController>()) { Stop(); } else if (coll.gameObject.GetComponent <RubbishController>()) { RubbishController sampahController = coll.gameObject.GetComponent <RubbishController>(); if (bubble.CanLift(sampahController) && !bubble.thrownRubbishes.Contains(sampahController) && !bubble.rubbishes.Contains(sampahController)) { bubble.LiftRubbish(sampahController); } else if (bubble.CanLiftWithThrowFirst(sampahController) && !bubble.thrownRubbishes.Contains(sampahController) && !bubble.rubbishes.Contains(sampahController)) { bubble.ThrowFirstRubbish(); bubble.LiftRubbish(sampahController); } else if (!bubble.rubbishes.Contains(sampahController)) { this.StickyOnRubbish(coll.gameObject); } } else if (coll.gameObject.GetComponent <OrangeBubbleController>()) { this.MergeBubble(coll.gameObject.GetComponent <BubbleController>()); } }
void OnTriggerEnter2D(Collider2D coll) { if (coll.gameObject.GetComponent <BarrierController>() && coll.gameObject.GetComponent <BarrierController>().isSpicky) { bubble.BrokenOut(); } else if (coll.gameObject.GetComponent <RubbishController>()) { RubbishController sampahController = coll.gameObject.GetComponent <RubbishController>(); if (!sampahController.IsLifted() && bubble.CanLift(sampahController) && !bubble.thrownRubbishes.Contains(sampahController)) { bubble.LiftRubbish(sampahController); } else if (!sampahController.IsLifted() && bubble.CanLiftWithThrowFirst(sampahController) && !bubble.thrownRubbishes.Contains(sampahController)) { bubble.ThrowFirstRubbish(); bubble.LiftRubbish(sampahController); } } }