private void OnClickEnter(EventContext context) { var data = UserData as DRAnimal; var fenceAreaId = GameEntry.DataNode.GetData <VarInt>("BuyAnimalFenceArea").Value; BuyAnimalCommand.Do(fenceAreaId, data.Id, 1); Close(); }
/// <summary> /// 创建指令 /// </summary> public static void Do(int fenceAreaId, int animalId, int count) { var command = new BuyAnimalCommand(); 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); }