public override void UpdateAction()
        {
            switch (state)
            {
            case StateType.TargetWalk:
                StellaMove.AdjustWalkResult res = StellaMove.AdjustWalk(targetX, StellaMove.MoveSpeed);
                if (res == StellaMove.AdjustWalkResult.Reach)
                {
                    state = StateType.Action;
                    StellaMove.myVelocity = Vector3.zero;
                    ToAction();
                }
                else if (res == StellaMove.AdjustWalkResult.Abort)
                {
                    // 移動できなければ歩きに戻します
                    StellaMove.myVelocity = Vector3.zero;
                    StellaMove.instance.ChangeAction(StellaMove.ActionType.NaeWalk);
                }
                break;

            case StateType.Action:
                StellaMove.myVelocity.x = 0f;
                StellaMove.instance.Move();
                break;
            }
        }
示例#2
0
        public override void UpdateAction()
        {
            switch (state)
            {
            case StateType.TargetWalk:
                StellaMove.AdjustWalkResult res = StellaMove.AdjustWalk(targetX, StellaMove.MoveSpeed);
                if ((res == StellaMove.AdjustWalkResult.Reach) ||
                    (res == StellaMove.AdjustWalkResult.Abort))
                {
                    state = StateType.Action;
                    StellaMove.myVelocity = Vector3.zero;
                    ToAction();
                }

                /*
                 * else if (res == StellaMove.AdjustWalkResult.Abort)
                 * {
                 *  // 移動できなければ歩きに戻します
                 *  StellaMove.myVelocity = Vector3.zero;
                 *
                 *  if (StellaMove.NowAction == StellaMove.ActionType.LiftUp)
                 *  {
                 *      ToWalk();
                 *  }
                 *  else
                 *  {
                 *      StellaMove.instance.ChangeAction(StellaMove.ActionType.NaeWalk);
                 *  }
                 * }
                 */
                break;

            case StateType.Action:
                StellaMove.myVelocity.x = 0f;
                StellaMove.instance.Move();
                break;
            }
        }