示例#1
0
    protected override object CreateDataObject()
    {
        List <GatherBot.GatherBotData> botData = new List <GatherBot.GatherBotData>();

        for (int i = 0; i < childBots.Count; i++)
        {
            botData.Add(childBots[i].GetData());
        }
        return(new HiveSaveData(transform.position, DefaultInventory.GetInventoryData(), botData));
    }
示例#2
0
    public override void ApplyData(EntityData?data)
    {
        if (data == null)
        {
            return;
        }
        HiveSaveData d = (HiveSaveData)((EntityData)data).data;

        transform.position = d.position;
        DefaultInventory.SetData(d.inventory);
        for (int i = 0; i < d.botData.Count; i++)
        {
            CreateBot(GetAvailableDockID(), true).ApplyData(d.botData[i]);
        }
    }