/// <summary> /// 初始化地图 /// </summary> public void InitMap(int[][] obMapInfo, int[][] buildingMapInfo) { //// 判断是否已经设置数据 //if (!GlobalData.FightData.IsSetData) //{ // Debug.LogError("战斗数据未设置."); // return; //} Clear(); // 清理数据 // 加载障碍曾 mapInfoData = obMapInfo; // 加载建筑层 mapInfoBuildingData = buildingMapInfo; MapWidth = mapInfoData[0].Length; MapHeight = mapInfoData.Length; //// 目标点向对方基地/炮塔前进 //if (TargetX >= MapWidth || TargetX < 0) //{ // TargetX = MapWidth - 1; //} //if (TargetY >= MapHeight || TargetY < 0) //{ // TargetY = MapHeight - 1; //} // 初始化地图宽度 UnitWidth = (int)SData_Constant.Single.GetDataOfID(Utils.UnitWidthId).Value; LoadMap.Init(mapInfoData, UnitWidth); // 初始化集群管理 var loadMapPos = LoadMap.GetCenter(); ClusterManager.Single.Init(loadMapPos.x, loadMapPos.z, MapWidth, MapHeight, UnitWidth, mapInfoData); }
void Start() { // 启动TriggerTicker TriggerTicker.Single.Start(); // 设定帧数 Application.targetFrameRate = 60; var loadMapPos = LoadMap.GetCenter(); ClusterManager.Single.Init(loadMapPos.x + LoadMap.MapWidth * LoadMap.UnitWidth, loadMapPos.z + LoadMap.MapHeight * LoadMap.UnitWidth, MapWidth, MapHeight, UnitWidth, null); // 启动显示管理器 DisplayerManager.AutoInstance(); // 启动携程器 CoroutineManage.AutoInstance(); // 启动数据管理器 DataManager.AutoInstance(); // 初始化资源 InitPack(); // 初始化lua InitLua(); // 初始化技能 InitSkill(); }