Exemplo n.º 1
0
 public void Move(MotionScript motionObject)
 {
     if (motionObject.IsFinished && IsAbleToMove())
     {
         m_currentMotion = null;
         var toPosition = m_tile.GetNextPosition();
         toPosition.y += Next.Height;
         motionObject.StartMotion(toPosition, Speed);
         Next.HoldMotion(motionObject);
     }
 }
Exemplo n.º 2
0
 private void Update()
 {
     if (m_currentMotion != null)
     {
         if (m_currentMotion.IsFinished)
         {
             var    getter      = GetterObject;
             IMover getterMover = getter?.GetComponent <IMover>();
             if (getterMover?.IsFree() ?? false)
             {
                 getterMover.HoldMotion(m_currentMotion);
                 m_currentMotion = null;
             }
         }
     }
 }