예제 #1
0
 // Update is called once per frame
 void Update()
 {
     future      = pcs.GetFuture();
     currentRoom = pcs.GetRoom();
     if (!future)
     {
         destination = pastAnchors[currentRoom].transform;
     }
     else if (future)
     {
         destination = futureAnchors[currentRoom].transform;
     }
     if (pcs.canMove)
     {
         MoveToAnchor(currentRoom);
     }
     if (lastKnownRoom != currentRoom)
     {
         float d = destination.transform.position.x - this.transform.position.x;
         if (pcs.GetMove())
         {
         }
         else
         {
             if (d > .01)
             {
                 this.transform.Translate(8 * Time.deltaTime, 0.0f, 0.0f, Space.World);
             }
             else
             {
                 lastKnownRoom = currentRoom;
                 pcs.SetMove(true);
             }
         }
     }
     //Debug.Log("Future is " + future);
     //Debug.Log(pastAnchors[currentRoom].gameObject.transform);
 }