protected override void OnShow(object data) { base.OnShow(data); //根据设置来显示 foreach (var item in m_toggles) { BtnType btntype = (BtnType)System.Enum.Parse(typeof(BtnType), item.name); if (m_dicChannelType.ContainsKey(btntype)) { item.value = m_chatManager.SimpleChannelContain(m_dicChannelType[btntype]); } } foreach (var item in m_autotoggles) { BtnType btntype = (BtnType)System.Enum.Parse(typeof(BtnType), item.name); if (m_dicChannelType.ContainsKey(btntype)) { item.value = m_chatManager.IsAutoPlayVoice(m_dicChannelType[btntype]); } } IsLiuliangAuto = m_chatManager.IsAutoPlayInLiuLiang(); m_btn_liuliang.GetComponent <UIToggle>().value = IsLiuliangAuto; }