private void OnCollisionEnter(Collision collision) { RB_Ball ball = collision.gameObject.GetComponent <RB_Ball>(); if (ball != null) { ball.Launch(-(this.transform.position - ball.transform.position), force); } }
private void OnCollisionEnter(Collision collision) { RB_Ball ball = collision.gameObject.GetComponent <RB_Ball>(); if (ball != null) { StartCoroutine(Respawn(ball)); } }
private void OnTriggerEnter(Collider other) { RB_Ball ball = other.gameObject.GetComponent <RB_Ball>(); if (ball != null) { if (RB_Game_Controller.game_controller != null) { RB_Game_Controller.game_controller.Check_Answer((int)num_value_controller.Get_Value()); } } }
// Use this for initialization void Start() { if (game_controller == null) { game_controller = this; } ball = GameObject.FindObjectOfType <RB_Ball>(); board_loader = GameObject.FindObjectOfType <RB_Board_Loader>(); answer_controller = GetComponent <RB_Answer_Controller>(); difficulty_controller = GetComponent <RB_Difficulty_Controller>(); answer_tile = GameObject.FindObjectOfType <RB_Answer_Tile>(); ui_question = UI_Question_Display.ui_question_display; Set_Board(); }
private void OnCollisionStay(Collision collision) { RB_Ball ball = collision.gameObject.GetComponent <RB_Ball>(); if (ball != null) { time_in += Time.deltaTime; if (time_in >= time_stay_limit) { ball.Respawn(); time_in = 0.0f; } } }
IEnumerator Respawn(RB_Ball _ball) { yield return(new WaitForSeconds(spawn_time)); _ball.Respawn(); }