static void InitMapSettings(MapGenerator window) { if (FileHelp.FileExistInDataPathRelativePath(mapSettingsProfilesPath)) { ms = FileHelp.LoadJsonFormatObjectByDataPathRelativePath <MapSettings> (mapSettingsProfilesPath); } else { EditorWindow.GetWindow <MapGenerator>().Close(); throw new System.Exception(@"easy map cannot find map settings, did you forgot to generate one,please check 'MapTool/MapSettings'."); } }
void Initialize() { if (!valid) { return; } ms = FileHelp.LoadJsonFormatObjectByDataPathRelativePath <MapSettings> (MapSettings.mapSettingsProfilesPath); mapData = FileHelp.LoadJsonFormatObjectByDataPathRelativePath <MapData> (string.Format("{0}/{1}.json", ms.mapDataSavePathRelativeToProject, mapName)); widthDelta = mapTexTrans.rect.width / mapData.GetMapWidth(); heightDelta = mapTexTrans.rect.height / mapData.GetMapWidth(); staticMark = new List <GameObject>(); movingObjRelateMarkDic = new Dictionary <GameObject, GameObject>(); }
void Awake() { ms = FileHelp.LoadJsonFormatObjectByDataPathRelativePath <MapSettings> (MapSettings.mapSettingsProfilesPath); }