예제 #1
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Q))
     {
         donut.JumpRight();
     }
     else if (Input.GetKeyDown(KeyCode.E))
     {
         donut.JumpLeft();
     }
 }
예제 #2
0
        private IEnumerator AICoroutine()
        {
            while (true)
            {
                yield return(new WaitForSeconds(TimeBetweenLogicTicks));

                if (gameController.Sphere != null)
                {
                    if (gameController.Sphere.transform.position.y > transform.position.y)
                    {
                        if (gameController.Sphere.transform.position.x < transform.position.x)
                        {
                            hoop.JumpLeft();
                        }
                        else
                        {
                            hoop.JumpRight();
                        }
                    }
                }
            }
        }