private void LoadPassId() { GeneralConfigItem initPassIdConfig = GeneralConfigData.Get(GeneralConfigConstVal.INIT_PASS_ID); int initId = int.Parse(initPassIdConfig.content); foreach (PassItem itemConfig in PassData.items) { switch (itemConfig.sceneType) { case (int)SceneType.NormalScene: if (itemConfig.id / initId == 1) { if (itemConfig.id < m_MinNormalId) { m_MinNormalId = itemConfig.id; } if (itemConfig.id > m_MaxNormalId) { m_MaxNormalId = itemConfig.id; } } break; } } }
private void LoadFont() { FontMap = new Dictionary <string, Font>(); GeneralConfigItem cfg = GeneralConfigData.Get(GeneralConfigConstVal.LANGUAGE_LIST); for (int i = 0; i < cfg.contents.Length; i += 3) { Font font = Resources.Load <Font>(string.Format(CommonResourceConstVal.FONT_PATH, cfg.contents[i + 2])); FontMap[cfg.contents[i + 1]] = font; } }
public GeneralConfigItem Get(string id) { int min = 0; int max = items.Length; while (min < max) { int index = (min + max) >> 1; GeneralConfigItem item = _Items[index]; if (item.id == id) { return(item); } if (string.Compare(id, item.id) < 0) { max = index; } else { min = index + 1; } } return(null); }