private ScanFunction GetScanFunction(GameObject bubble) { ScanFunction scanFunction; if (powerUpType == PowerUpType.ThreeCombo) { scanFunction = () => { return(CastingUtil.FullRowBubbleCast(bubble, THREE_COMBO_ROWS, THREE_COMBO_ROWS)); }; } else if (powerUpType == PowerUpType.FourCombo) { scanFunction = () => { return(CastingUtil.FullRowBubbleCast(bubble, FOUR_COMBO_ROWS, FOUR_COMBO_ROWS)); }; } else { var type = powerUpType; scanFunction = () => { return(CastingUtil.RelativeBubbleCast(bubble, scanMap.Map[type])); }; } return(scanFunction); }
protected void OnEnable() { var bounds = gameObject.GetComponent <Collider2D>().bounds; var bubbles = CastingUtil.BoundsBoxCast(bounds, 1 << (int)Layers.GameObjects); foreach (var bubble in bubbles) { ActivateBubble(bubble.transform.gameObject, true); } }
protected bool IsTouchingBubbles() { return(CastingUtil.BoundsBoxCast(castingBox.bounds, 1 << (int)Layers.GameObjects).Length > 0); }