Exemplo n.º 1
0
        public static PlayerAssemblePartData LoadSaveData(AssemblePartGeneralSaveData saveData)
        {
            PlayerAssemblePartData data = new PlayerAssemblePartData();

            if (saveData == null)
            {
                DebugPlus.LogError("[AssemblePartGeneralSaveData] saveData is null");
                return(null);
            }
            //Load Design
            for (int i = 0; i < saveData.currentSaveDesignPart.Count; i++)
            {
                AssemblePartInfo info = new AssemblePartInfo();
                info.LoadSaveData(saveData.currentSaveDesignPart[i]);

                data.AddAssemblePartDesign(info);
            }
            //Load Storage
            for (int i = 0; i < saveData.currentSaveStoragePart.Count; i++)
            {
                AssemblePartInfo info = new AssemblePartInfo();
                info.LoadSaveData(saveData.currentSaveStoragePart[i]);
                data.AddAssemblePartStorage(info);
            }
            //Load Equiped
            for (int i = 0; i < saveData.currentSaveEquipedPart.Count; i++)
            {
                AssemblePartInfo info = new AssemblePartInfo();
                info.LoadSaveData(saveData.currentSaveEquipedPart[i]);
                data.AddAssemblePartStorage(info);
            }
            return(data);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Game Save
        /// </summary>
        /// <param name="saveData"></param>
        public void LoadPlayerSaveData(PlayerSaveData saveData, AssemblePartGeneralSaveData partSaveData)
        {
            resourceData = PlayerResourceData.LoadSave(saveData.playerSaveData_Resource);

            timeData = TimeData.LoadGameSave(saveData.timeSave);

            materialStorageData = MaterialStorageData.LoadSaveData(saveData.materialSaveData);
            assemblePartData    = PlayerAssemblePartData.LoadSaveData(partSaveData);
        }
Exemplo n.º 3
0
        public static PlayerAssemblePartData InitData()
        {
            PlayerAssemblePartData data = new PlayerAssemblePartData();
            var configData = Config.ConfigData.AssembleConfig.assemblePartMainType;

            for (int i = 0; i < configData.Count; i++)
            {
                if (!data.AssemblePartMainTypeDic.ContainsKey(configData[i].Type))
                {
                    data.AssemblePartMainTypeDic.Add(configData[i].Type, configData[i]);
                }
            }
            data._currentUnlockPartList = AssembleModule.GetAllUnlockPartTypeID();
            return(data);
        }
Exemplo n.º 4
0
        public bool InitData()
        {
            var config = Config.ConfigData.PlayerConfig;

            if (config == null || config.timeConfig == null)
            {
                DebugPlus.LogError("[PlayerData] : playerConfig is null!");
                return(false);
            }

            timeData = TimeData.InitData(config.timeConfig);

            resourceData = PlayerResourceData.InitData();

            assemblePartData = PlayerAssemblePartData.InitData();

            materialStorageData = new MaterialStorageData();
            //Init BuildPanel
            UnLockBuildingPanelDataList = PlayerModule.GetUnLockBuildData();
            return(true);
        }