예제 #1
0
 private void FixedUpdate()
 {
     nextPosition = Controller.GetNetworkPosition();
     distance     = Vector2.Distance(transform.position, nextPosition);
     if (distance > 0.01f)
     {
         t = distance * (1 / MoveSpeed);
         transform.position = Vector2.Lerp(transform.position, nextPosition, t);
     }
 }
예제 #2
0
 public override void NetworkStart()
 {
     if (IsServer)
     {
         enabled = false;
     }
     else
     {
         Controller         = GetComponent <IMoveableObject>();
         MoveSpeed          = Controller.GetMoveSpeed();
         transform.position = Controller.GetNetworkPosition();
     }
 }