コード例 #1
0
 public bool Left()
 {
     if (current)
     {
         SlotComponent mLeft = current.MostLeft(this);
         if (Move(mLeft, mLeft.x - current.x))
         {
             animator.SetTrigger("trigger_left");
         }
         else
         {
             return(false);
         }
     }
     else
     {
         Debug.LogError("slot reference missing (id:" + id + ")");
     }
     return(true);
 }
コード例 #2
0
 public SlotComponent MostLeft(BoxComponent box)
 {
     if (LEFT != null)
     {
         if (LEFT.IsEmpty)
         {
             return(LEFT.MostLeft(box));
         }
         else if (LEFT.IsMergable(box))
         {
             return(LEFT);
         }
         else
         {
             return(this);
         }
     }
     else
     {
         return(this);
     }
 }