Пример #1
0
 public override void SimulateController()
 {
     if (destination != null)
     {
         IClickToMoveCommandInput input = ClickToMoveCommand.Create();
         input.click = destination.position;
         entity.QueueInput(input);
     }
 }
Пример #2
0
        public override void ExecuteCommand(Command command, bool resetState)
        {
            ClickToMoveCommand cmd = (ClickToMoveCommand)command;

            if (resetState)
            {
                //owner has sent a correction to the controller
                transform.position = cmd.Result.position;
            }
            else
            {
                if (cmd.Input.click != Vector3.zero)
                {
                    gameObject.SendMessage("SetTarget", cmd.Input.click);
                }

                cmd.Result.position = transform.position;
            }
        }