Esempio n. 1
0
 public void OnStartBeastRound(long unBeastId)
 {
     for (int i = 0; i < this.m_listMapNodeBuilding.Count; i++)
     {
         MapNodeBuilding mapNodeBuilding = this.m_listMapNodeBuilding[i];
         mapNodeBuilding.OnStartBeastRound(unBeastId);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 显示所有格子模型
 /// </summary>
 /// <param name="eMapNodeType"></param>
 /// <param name="bVisible"></param>
 public void SetMapNodeBuildingVisible(EMapNodeType eMapNodeType, bool bVisible)
 {
     for (int i = 0; i < this.m_listMapNodeBuilding.Count; i++)
     {
         MapNodeBuilding mapNodeBuilding = this.m_listMapNodeBuilding[i];
         if (mapNodeBuilding.MapNodeType == eMapNodeType)
         {
             mapNodeBuilding.SetVisible(bVisible);
         }
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 不显示格子建筑高亮
 /// </summary>
 /// <param name="eShowHexagonType"></param>
 public void ClearHexagon(EnumShowHexagonType eShowHexagonType)
 {
     if (eShowHexagonType == EnumShowHexagonType.eShowHexagonType_Highlight)
     {
         for (int i = 0; i < this.m_listMapNodeBuilding.Count; i++)
         {
             MapNodeBuilding mapNodeBuilding = this.m_listMapNodeBuilding[i];
             mapNodeBuilding.IsHighlight = false;
         }
     }
 }
Esempio n. 4
0
        /// <summary>
        /// 根据格子类型取得MapNodeBuilding类
        /// </summary>
        /// <param name="eMapNodeType"></param>
        /// <returns></returns>
        public MapNodeBuilding GetMapNodeBuildingByType(EMapNodeType eMapNodeType)
        {
            MapNodeBuilding result = null;

            foreach (var build in this.m_listMapNodeBuilding)
            {
                if (build.MapNodeType == eMapNodeType)
                {
                    result = build;
                }
            }
            return(result);
        }
Esempio n. 5
0
        /// <summary>
        /// 是否开启基地的碰撞器的启动
        /// </summary>
        /// <param name="enable"></param>
        public void ControlColliderEnable(bool enable)
        {
            MapNodeBuilding base1 = this.GetMapNodeBuildingByType(EMapNodeType.MAP_NODE_EMPIRE_BASE);

            if (base1 != null)
            {
                base1.IsCollider = enable;
            }
            MapNodeBuilding base2 = this.GetMapNodeBuildingByType(EMapNodeType.MAP_NODE_LEAGUE_BASE);

            if (base2 != null)
            {
                base2.IsCollider = enable;
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 创建格子模型建筑
        /// </summary>
        /// <param name="scene"></param>
        public void CreateTerrainBuildings(CScene scene)
        {
            foreach (var XYAndNode in scene.DicMapData)
            {
                foreach (var YAndNode in XYAndNode.Value)
                {
                    MapNode         node            = YAndNode.Value;
                    MapNodeBuilding mapNodeBuilding = new MapNodeBuilding();
                    mapNodeBuilding.MapNodeType = node.m_eMapNodeType;
                    mapNodeBuilding.HexPos      = new CVector3(node.nIndexX, node.nIndexY, node.nIndexU);
                    //从服务器收到动态地图的消息,里面存储不同格子坐标上的不同建筑
                    if (this.m_ListNodeData != null)
                    {
                        for (int i = 0; i < this.m_ListNodeData.Count; i++)
                        {
                            if (mapNodeBuilding.HexPos.Equals(this.m_ListNodeData[i].m_oPos))
                            {
                                EMapNodeType eMapNodeType = (EMapNodeType)this.m_ListNodeData[i].m_nType;
                                mapNodeBuilding.MapNodeType = eMapNodeType;
                                mapNodeBuilding.ChangeNodeType(eMapNodeType);
                                this.m_sceneCurrent.ChangeMapNodeType(this.m_ListNodeData[i].m_oPos, MapCfg.MapNodeType2String(eMapNodeType));
                                break;
                            }
                        }
                    }

                    //DataTerrain_node dataByType = DataTerrain_nodeManager.Instance.GetDataByType(MapCfg.MapNodeType2String(node.m_eMapNodeType));
                    DataTerrainNode dataByType = GameData <DataTerrainNode> .dataMap[MapCfg.MapNodeTypeToInt(node.m_eMapNodeType)];
                    if (null != dataByType)
                    {
                        mapNodeBuilding.EffectId        = dataByType.EffectId;
                        mapNodeBuilding.TriggerEffectId = dataByType.TriggerEffectId;
                    }
                    //初始化基地模型
                    MapNodeTypeInfo mapNodeTypeInfo = null;
                    if (scene.DicMapNodeTypeInfo.TryGetValue(node.m_eMapNodeType, out mapNodeTypeInfo))
                    {
                        mapNodeBuilding.ModelFile       = mapNodeTypeInfo.ModelFile;
                        mapNodeBuilding.OriginModelFile = mapNodeTypeInfo.ModelFile;
                        mapNodeBuilding.ChangeModel();
                    }
                    this.m_listMapNodeBuilding.Add(mapNodeBuilding);
                }
            }
        }
Esempio n. 7
0
 /// <summary>
 /// 显示格子建筑是否高亮
 /// </summary>
 /// <param name="eShowHexagonType"></param>
 /// <param name="listHex"></param>
 public void ShowHexagon(EnumShowHexagonType eShowHexagonType, List <CVector3> listHex)
 {
     if (eShowHexagonType == EnumShowHexagonType.eShowHexagonType_Highlight)
     {
         for (int i = 0; i < this.m_listMapNodeBuilding.Count; i++)
         {
             MapNodeBuilding mapNodeBuild = this.m_listMapNodeBuilding[i];
             if (listHex != null && listHex.Exists((CVector3 p) => p.Equals(mapNodeBuild.HexPos)))
             {
                 mapNodeBuild.IsHighlight = true;
             }
             else
             {
                 mapNodeBuild.IsHighlight = false;
             }
         }
     }
 }