示例#1
0
文件: Unit.cs 项目: Northcode/ncdf
 public void MoveLeft(UDirection direction)
 {
     if(MovementCheckX(x - 1))
     {
         lx = x;
         ly = y;
         x = x - 1;
     }
 }
示例#2
0
文件: Unit.cs 项目: Northcode/ncdf
 public void MoveDown(UDirection direction)
 {
     if(MovementCheckY(y + 1))
     {
         lx = x;
         ly = y;
         y = y + 1;
     }
 }
示例#3
0
文件: Unit.cs 项目: Northcode/ncdf
 public void Move(UDirection direction)
 {
     switch (direction)
     {
         case UDirection.Up:
             mUp(direction);
             break;
         case UDirection.Down:
             mDown(direction);
             break;
         case UDirection.Left:
             mLeft(direction);
             break;
         case UDirection.Right:
             mRight(direction);
             break;
     }
 }
示例#4
0
文件: Unit.cs 项目: Northcode/ncdf
 public void MoveRight(UDirection direction)
 {
     if(MovementCheckX(x + 1))
     {
         lx = x;
         ly = y;
         x = x + 1;
     }
 }
示例#5
0
文件: Unit.cs 项目: Northcode/ncdf
 public void MoveUp(UDirection direction)
 {
     if(MovementCheckY(y - 1))
     {
         lx = x;
         ly = y;
         y = y - 1;
     }
 }
示例#6
0
 public override void Reset()
 {
     base.Reset();
     this.Direction      = UIAnimator.DefaultDirection;
     this.CustomPosition = Vector3.zero;
 }