/// <summary> /// 创建单选 /// </summary> public UIListItemGameSettingRB CreateItemForRB(string title, Action <bool> callBack) { GameObject objItem = LoadItem("ListItemGameSettingRB"); UIListItemGameSettingRB rbItem = objItem.GetComponent <UIListItemGameSettingRB>(); rbItem.SetData(title, callBack); return(rbItem); }
public override void Open() { base.Open(); listAntiAliasingQualityLevelData = new List <string>() { TextHandler.Instance.GetTextById(10011), TextHandler.Instance.GetTextById(10012), TextHandler.Instance.GetTextById(10013) }; listShadowResolutionLevelData = new List <string>() { TextHandler.Instance.GetTextById(10011), TextHandler.Instance.GetTextById(10012), TextHandler.Instance.GetTextById(10013), TextHandler.Instance.GetTextById(10014) }; //是否全屏 settingFullScreen = CreateItemForRB(TextHandler.Instance.GetTextById(102), HandleForFullScreen); settingFullScreen.SetState(gameConfig.window == 1 ? true : false); //屏幕分辨率 settingScreenResolutionSelect = CreateItemForSelect(TextHandler.Instance.GetTextById(111), listScreenResolutionData, HandleForScreenResolution); int indexScreenResolutionSelect = GetScreenResolutionIndex(gameConfig.screenResolution); settingScreenResolutionSelect.SetIndex(indexScreenResolutionSelect); //显示帧数 settingFrameShow = CreateItemForRB(TextHandler.Instance.GetTextById(110), HandleForFrameShow); settingFrameShow.SetState(gameConfig.framesShow); //锁定帧数 settingLockFrame = CreateItemForRB(TextHandler.Instance.GetTextById(103), HandleForLockFrame); settingLockFrame.SetState(gameConfig.stateForFrames == 1 ? true : false); //帧数 settingFrame = CreateItemForRange(TextHandler.Instance.GetTextById(104), HandleForFrame); settingFrame.SetPro((gameConfig.frames - 20) / 100f); //UI大小 settingUISize = CreateItemForSelect(TextHandler.Instance.GetTextById(113), listUISizeData, HandleForUISize); settingUISize.SetIndex(GetUISizeIndex(gameConfig.uiSize)); //阴影质量等级 settingShadowResolutionLevelData = CreateItemForSelect(TextHandler.Instance.GetTextById(112), listShadowResolutionLevelData, HandleForShadowResolutionLevel); settingShadowResolutionLevelData.SetIndex(gameConfig.shadowResolutionLevel); //阴影距离 settingShadowDis = CreateItemForRange(TextHandler.Instance.GetTextById(105), HandleForShadowDis); settingShadowDis.SetPro(gameConfig.shadowDis / 200); //抗锯齿 settingAntiAliasingSelect = CreateItemForSelect(TextHandler.Instance.GetTextById(108), listAntiAliasingData, HandleForAntiAliasing); settingAntiAliasingSelect.SetIndex((int)gameConfig.GetAntialiasingMode()); //抗锯齿质量 settingAntiAliasingQualityLevelSelect = CreateItemForSelect(TextHandler.Instance.GetTextById(109), listAntiAliasingQualityLevelData, HandleForAntiAliasingQualityLevel); settingAntiAliasingQualityLevelSelect.SetIndex(gameConfig.antialiasingQualityLevel); }