void OnTriggerEnter2D(Collider2D other) { Ball_scr ball = other.GetComponent <Ball_scr>(); if (ball != null) { ball.Stop_ball(); ball.Move_to(SetFirePosition.Instance.LaunchPosition2d()); } }
void OnTriggerEnter2D(Collider2D col) { Ball_scr ball = col.GetComponent <Ball_scr>(); if (ball != null) { gameObject.GetComponent <Slider_scr>().Destroy_after_slide = true; StartCoroutine(Flash()); BlockControl.Instance.HitBlocksHorizontalAndVertical(transform.position); } }
void Instantiate_balls_if_needed() { if (current_ball_count != GAME_MASTER.Instance.Level) //if level ups ball instantitates { Ball_scr Ball_s = (Instantiate(ball_prefab, SetFirePosition.Instance.LaunchPosition(), Quaternion.identity) as GameObject).GetComponent <Ball_scr>(); ball_Arr.Add(Ball_s); current_ball_count++; } if (current_ball_count > GAME_MASTER.Instance.Level) { Destroy(ball_Arr[0]); } }