示例#1
0
    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();
    }
示例#2
0
    /// <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);
    }