IEnumerator BallCalculating() { while (true) { if (touchController.GetDirection().y != 0) { direction = touchController.GetDirection(); } if (touchController.GetGameObjectFromMouseDrag() == this.gameObject) { if (touchController.pointerUp) { //Debug.Log(direction); Moving(direction.y); if (quizController) { //Debug.Log("Before Result"); //touchController.gameObject.SetActive(false); //yield return new WaitForSeconds(quizController.waitTime); yield return(quizController.CheckResult()); //Debug.Log("Updated Result"); //touchController.gameObject.SetActive(true); } } } yield return(null); } }
// Update is called once per frame void Update() { if (touchController.GetGameObjectFromMouseDrag() == this.gameObject) { Reset(); //direction = Vector2.zero; } }