public void GenerateFullInfo() { this.m_MapFullInfo = new CMapParser.CMapFullInfo(); this.m_MapFullInfo.name = this.m_MapName; this.m_MapFullInfo.hard = this.m_MapHard; this.m_MapFullInfo.limit = this.m_MapLimitRotate; this.m_MapFullInfo.backgroundColor = string.Format("#{0}", ColorUtility.ToHtmlStringRGB(Camera.main.backgroundColor)); this.m_MapFullInfo.tileBorderFolder = this.m_TileBorderFolder; this.m_MapFullInfo.tileFolder = this.m_TileFolder; this.m_MapFullInfo.markerFolder = this.m_MarkerFolder; this.m_MapFullInfo.cloudFolder = this.m_CloudFolder; this.m_MapFullInfo.rainFolder = this.m_RainFolder; this.m_MapFullInfo.map = this.m_Grid; this.m_MapFullInfo.clouds = new CMapParser.CMapFullInfo.CCloudInfo[this.m_CloudLists.Count]; for (int i = 0; i < this.m_CloudLists.Count; i++) { var cloud = this.m_CloudLists[i]; if (cloud != null) { this.m_MapFullInfo.clouds[i] = new CMapParser.CMapFullInfo.CCloudInfo(); this.m_MapFullInfo.clouds[i].index = cloud.index; this.m_MapFullInfo.clouds[i].spot1 = string.Format("{0},{1},{2}", cloud.spot.x, cloud.spot.y, cloud.spot.z); this.m_MapFullInfo.clouds[i].spot2 = string.Format("{0},{1},{2}", cloud.move.x, cloud.move.y, cloud.move.z); this.m_MapFullInfo.clouds[i].rotate = cloud.GetRotationStr(); this.m_MapFullInfo.clouds[i].data = cloud.cloudGrid; } } Debug.Log(TinyJSON.JSON.Dump(this.m_MapFullInfo)); GUIUtility.systemCopyBuffer = TinyJSON.JSON.Dump(this.m_MapFullInfo); }
public void LoadMapData() { if (string.IsNullOrEmpty(MAP_ASSET) == false) { this.m_MapParsed = CMapParser.parseMap(MAP_ASSET); // GAME this.m_LimitRotate = this.m_MapParsed.limit; // GRID this.m_Width = this.m_MapParsed.map.GetLength(0); this.m_Height = this.m_MapParsed.map.GetLength(1); this.m_Grid = new int[this.m_Width, this.m_Height]; System.Buffer.BlockCopy(this.m_MapParsed.map, 0, this.m_Grid, 0, this.m_MapParsed.map.Length * sizeof(int)); // CLOUD this.m_CloudGroups = new CMapParser.CMapFullInfo.CCloudInfo[this.m_MapParsed.clouds.Length]; System.Array.Copy(this.m_MapParsed.clouds, this.m_CloudGroups, this.m_MapParsed.clouds.Length); // FOLDER Color cameraBackground; if (ColorUtility.TryParseHtmlString(this.m_MapParsed.backgroundColor, out cameraBackground)) { Camera.main.backgroundColor = cameraBackground; } this.m_TileBorderFolder = this.m_MapParsed.tileBorderFolder; this.m_TileFolder = this.m_MapParsed.tileFolder; this.m_MarkerFolder = this.m_MapParsed.markerFolder; this.m_CloudFolder = this.m_MapParsed.cloudFolder; this.m_RainFolder = this.m_MapParsed.rainFolder; } }
public void LoadMapDataWithAsset() { if (this.m_MapAsset == null) { return; } var mapAsset = this.m_MapAsset; this.m_MapFullInfo = CMapParser.parseMap(mapAsset.text); // GAME this.m_MapName = this.m_MapFullInfo.name; this.m_MapHard = this.m_MapFullInfo.hard; this.m_LimitRotate = this.m_MapFullInfo.limit; Color cameraBackground; if (ColorUtility.TryParseHtmlString(this.m_MapFullInfo.backgroundColor, out cameraBackground)) { Camera.main.backgroundColor = cameraBackground; } this.m_TileBorderFolder = this.m_MapFullInfo.tileBorderFolder; this.m_TileFolder = this.m_MapFullInfo.tileFolder; this.m_MarkerFolder = this.m_MapFullInfo.markerFolder; this.m_CloudFolder = this.m_MapFullInfo.cloudFolder; this.m_RainFolder = this.m_MapFullInfo.rainFolder; // GRID this.m_Width = this.m_MapFullInfo.map.GetLength(0); this.m_Height = this.m_MapFullInfo.map.GetLength(1); this.m_Grid = new int[this.m_Width, this.m_Height]; System.Buffer.BlockCopy(this.m_MapFullInfo.map, 0, this.m_Grid, 0, this.m_MapFullInfo.map.Length * sizeof(int)); // CLOUD this.m_CloudGroups = new CMapParser.CMapFullInfo.CCloudInfo[this.m_MapFullInfo.clouds.Length]; System.Array.Copy(this.m_MapFullInfo.clouds, this.m_CloudGroups, this.m_MapFullInfo.clouds.Length); // GENARATE this.GenerateCloudGroup(); this.GenerateMarker(); }