コード例 #1
0
 private void Update()
 {
     if (isMoving /*|| can gain*/ && playManager.CanGainResource(type))
     {
         transform.position = transform.position + (moveTarget - transform.position) / (moveTarget - transform.position).magnitude * Time.deltaTime;
     }
     else
     {
         transform.position = Vector3.Lerp(transform.position, oldPositionInTransform, 3 * Time.deltaTime);
     }
 }