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); } }
private void PlayerMovementTouch() { if (touchControlla.GetDirection().x > 200) { transform.Rotate(0, 0, 90); colorSwitch++; if (colorSwitch > shapeColors.Length - 1) { colorSwitch = 0; } rend.material.color = shapeColors[colorSwitch]; } else if (touchControlla.GetDirection().x < -200) { transform.Rotate(0, 0, -90); colorSwitch--; if (colorSwitch < 0) { colorSwitch = shapeColors.Length - 1; } rend.material.color = shapeColors[colorSwitch]; } }