private void OnClickEnter(EventContext context) { var animalId = (int)UserData; var fenceAreaId = GameEntry.DataNode.GetData <VarInt>("BuyAnimalFenceArea").Value; SellAnimalCommand.Do(fenceAreaId, animalId, 1); Close(); }
/// <summary> /// 创建指令 /// </summary> public static void Do(int fenceAreaId, int animalId, int count) { var command = new SellAnimalCommand(); command.FenceAreaId = fenceAreaId; command.AnimalId = animalId; command.Count = count; var sequence = GameEntry.Command.Sequence(); sequence.AppendCommand(command); sequence.AppendCommand(new DataUpdatedCommand()); sequence.AppendResultHandler(command.HandleResult); }