コード例 #1
0
 // Update is called once per frame
 void Update()
 {
     if (IsIdle())
     {
         Body.transform.position = Destination;
         Movement.AddMovement(Vector2.zero);
     }
     else
     {
         Movement.AddMovement((Destination - (Vector2)Body.transform.position).normalized);
     }
 }
コード例 #2
0
 private void FixedUpdate()
 {
     Movement.AddMovement(new Vector2(Input.GetAxis(HorisontalAxis), Input.GetAxis(VerticalAxis)));
 }