コード例 #1
0
        public override void Run()
        {
            if (dirChenged == false)
            {
                botEntityAnimation.MoveAnimation(direction, false);
                dirChenged = true;
            }

            moveCount--;

            if (useCallback)
            {
                useCallback = false;
                directionChangeCallback();
            }

            botEntityAnimation.MoveAnimation(direction, true);
            switch (direction)
            {
            case Direction.Up:
                botEntity.MoveY(speed, tileMapInfo);
                break;

            case Direction.Down:
                botEntity.MoveY(-speed, tileMapInfo);
                break;

            case Direction.Left:
                botEntity.MoveX(-speed, tileMapInfo);
                break;

            case Direction.Right:
                botEntity.MoveX(speed, tileMapInfo);
                break;
            }

            movingCallback();
            if (moveCount <= 0)
            {
                botEntityAnimation.ResetAnimation();
                if (noPosFix == false)
                {
                    botEntity.PosFix(tileMapInfo);
                }
                Finished();
            }
        }
コード例 #2
0
 public override void Run()
 {
     directionChangeCallback();
     botEntityAnimation.MoveAnimation(direction, false);
     Finished();
 }