示例#1
0
 public bool Create(int id)
 {
     if (PlayerModule.GetBuildingPanelDataByKey(id) != null)
     {
         _id = id;
         return(true);
     }
     return(false);
 }
示例#2
0
        public float GamePrepare_Research_Coefficient = 1;  //研究系数
        public void GetPrepare_Research_Coefficient(int level)
        {
            var propertyData = preparePropertyDataList.Find(x => x.configID == Config.ConfigData.PlayerConfig.gamePrepareConfig.GamePrepareConfig_PropertyLink_Research_Coefficient);

            if (propertyData == null)
            {
                GetPrepare_Research_Coefficient_Default();
                return;
            }
            var data      = PlayerModule.GetGamePrepareConfigItem(propertyData.configID);
            var levelData = data.levelMap.Find(x => x.Level == level);

            GamePrepare_Research_Coefficient = (float)levelData.numParam;
        }
示例#3
0
        public void GetPrepare_RoCore(int level)
        {
            var propertyData = preparePropertyDataList.Find(x => x.configID == Config.ConfigData.PlayerConfig.gamePrepareConfig.GamePrepareConfig_PropertyLink_RoCore);

            if (propertyData == null)
            {
                GetPrepare_RoCore_Default();
                return;
            }
            var data      = PlayerModule.GetGamePrepareConfigItem(propertyData.configID);
            var levelData = data.levelMap.Find(x => x.Level == level);

            GamePrepare_RoCore = (ushort)levelData.numParam;
        }
示例#4
0
        public int GamePrepare_ResourceRichness = 0;  //资源丰富度
        public void GetPrepare_ResourceRichness(int level)
        {
            var propertyData = preparePropertyDataList.Find(x => x.configID == Config.ConfigData.PlayerConfig.gamePrepareConfig.GamePrepareConfig_PropertyLink_Resource_Richness);

            if (propertyData == null)
            {
                GetPrepare_ResourceRichness_Default();
                return;
            }
            var data      = PlayerModule.GetGamePrepareConfigItem(propertyData.configID);
            var levelData = data.levelMap.Find(x => x.Level == level);

            GamePrepare_ResourceRichness = levelData.Level;
        }
示例#5
0
        private void HandleTechCompleteEvent(int techID)
        {
            var effect = TechnologyModule.Instance.GetTechCompleteEffect(techID);

            for (int i = 0; i < effect.Count; i++)
            {
                var type = TechnologyModule.Instance.GetTechCompleteType(effect[i]);
                switch (type)
                {
                case TechCompleteEffect.Unlock_Tech:
                    var techList = TechnologyModule.ParseTechParam_Unlock_Tech(effect[i].effectParam);
                    for (int j = 0; j < techList.Count; j++)
                    {
                        var info = GetTechInfo(techList[j]);
                        info.currentState = TechnologyState.Unlock;
                    }
                    break;

                case TechCompleteEffect.Unlock_Block:
                    var blockList = TechnologyModule.ParseTechParam_Unlock_Block(effect[i].effectParam);
                    for (int j = 0; j < blockList.Count; j++)
                    {
                        var buildData = PlayerModule.GetBuildingPanelDataByKey(blockList[j]);
                        if (buildData != null)
                        {
                            PlayerManager.Instance.AddUnLockBuildData(buildData);
                        }
                    }
                    break;

                case TechCompleteEffect.Unlock_Assemble_Part_Preset:
                    var partList = TechnologyModule.ParseTechParam_Unlock_Assemble_Part(effect[i].effectParam);
                    for (int j = 0; j < partList.Count; j++)
                    {
                        PlayerManager.Instance.AddUnlockAssemblePartID(partList[j]);
                    }
                    break;

                case TechCompleteEffect.Unlock_Assemble_Ship_Preset:
                    var shipList = TechnologyModule.ParseTechParam_Unlock_Assemble_Ship(effect[i].effectParam);
                    for (int j = 0; j < shipList.Count; j++)
                    {
                        PlayerManager.Instance.AddUnlockAssembleShipID(shipList[j]);
                    }
                    break;
                }
            }
        }
示例#6
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);
        }
示例#7
0
        /// <summary>
        /// 选择建筑,面板
        /// </summary>
        void HandleBlockPanelSelect()
        {
            if (isSelectBlock_Panel == true && currentSelectBuildID != -1)
            {
                if (CameraManager.Instance.InBlockPanelPos() == false)
                {
                    return;
                }
                if (_hasAddBlockToMap == false)
                {
                    var pos = CameraManager.Instance.TryGetRaycastHitGround(Input.mousePosition);
                    currentInitBlock = FunctionBlockManager.Instance.AddFunctionBlock(PlayerModule.GetBuildingPanelDataByKey(currentSelectBuildID).FunctionBlockID, (int)pos.x, (int)pos.z);
                    currentInitBlock.currentState = FunctionBlockBase.BlockState.Move;
                    currentInitBlock.SetSelect(true);
                    _hasAddBlockToMap = true;
                    CameraManager.Instance.currentBlockMode = CameraManager.BlockMode.Move;
                }
                else if (_hasAddBlockToMap == true && currentInitBlock != null)
                {
                    CameraManager.Instance.UpdateBlockMove(currentInitBlock);
                }
            }

            /// ESC to  Delete
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                if (_hasAddBlockToMap == true)
                {
                    FunctionBlockManager.Instance.RemoveItem(currentInitBlock);
                    currentInitBlock  = null;
                    _hasAddBlockToMap = false;
                    InitBlockBuildPanelSelect(-1, false);
                    CameraManager.Instance.currentBlockMode = CameraManager.BlockMode.None;
                    CameraManager.Instance.ResetDragState();
                }
            }
        }