コード例 #1
0
 private void HandleInput()
 {
     if (!Npc)
     {
         _currentAngle -= Input.GetAxis("Horizontal") * Time.fixedDeltaTime * _speed;
     }
     else
     {
         _closestBall = _ballManager.GetClosestBall(_transform);
         if (Utils.Vector2Extension.GetRadiant(_transform.position) -
             Utils.Vector2Extension.GetRadiant(_closestBall.transform.position)
             > Time.deltaTime * _speed)
         {
             _currentAngle -= Time.fixedDeltaTime * _speed;
         }
         else if (Utils.Vector2Extension.GetRadiant(_closestBall.transform.position) -
                  Utils.Vector2Extension.GetRadiant(_transform.position)
                  > Time.deltaTime * _speed)
         {
             _currentAngle += Time.fixedDeltaTime * _speed;
         }
     }
 }