Esempio n. 1
0
 public virtual bool IsDone()
 {
     foreach (MoveObject mover in moveObjects)
     {
         if (!mover.hasTraveledFullCycle)
         {
             return(false);
         }
     }
     ComplexTimer.Resume();
     return(ComplexTimer.IsAtEnd());
 }
Esempio n. 2
0
 void FixedUpdate()
 {
     if (GameManager.paused || GameManager.isInSceneTransition)
     {
         return;
     }
     if (moveSpeed != 0)
     {
         transform.position = Vector2.Lerp(transform.position, wayPoints[currentWaypoint].transform.position, moveSpeed * (1f / Vector2.Distance(transform.position, wayPoints[currentWaypoint].transform.position)));
     }
     if (rotateSpeed != 0)
     {
         transform.rotation = Quaternion.Slerp(transform.rotation, wayPoints[currentWaypoint].transform.rotation, rotateSpeed * (1f / Quaternion.Angle(transform.rotation, wayPoints[currentWaypoint].transform.rotation)));
     }
     if ((transform.position == wayPoints[currentWaypoint].transform.position || moveSpeed == 0) && (transform.up == wayPoints[currentWaypoint].transform.up || rotateSpeed == 0))
     {
         waitTimer.value.max = wayPoints[currentWaypoint].waitTime;
         waitTimer.Resume();
         if (waitTimer.IsAtEnd())
         {
             OnReachedWaypoint();
         }
     }
 }
Esempio n. 3
0
 public void OnCollisionEnter2D(Collision2D coll)
 {
     breakTimer.Resume();
 }