public void CreateUI() { if (this.naviController != null) { this.naviController.HideNavibar(true); } uiHome = (UIHomeBase)GameObject.Instantiate(uiHomePrefab); uiHome.SetController(this); UIViewController.ClonePrefabRectTransform(uiHomePrefab.gameObject, uiHome.gameObject); uiHome.Init(); }
/// <summary> /// Awake is called when the script instance is being loaded. /// </summary> void Awake() { if (btnShare != null) { btnShare.gameObject.SetActive(Config.main.isHaveShare); } if (btnNoAd != null) { btnNoAd.gameObject.SetActive(Config.main.isHaveRemoveAd); } if (btnMore != null) { if (!AppVersion.appCheckHasFinished) { btnMore.gameObject.SetActive(false); } if (Common.isAndroid) { if ((Config.main.channel == Source.HUAWEI) || (Config.main.channel == Source.GP)) { //华为市场不显示 btnMore.gameObject.SetActive(false); } } if (Common.isWinUWP) { btnMore.gameObject.SetActive(false); } if (Application.isEditor) { btnMore.gameObject.SetActive(true); } } if (btnAdVideo != null) { btnAdVideo.gameObject.SetActive(true); if ((Common.noad) || (!AppVersion.appCheckHasFinished)) { btnAdVideo.gameObject.SetActive(false); } if (Common.isAndroid) { if (Config.main.channel == Source.GP) { //GP市场不显示 btnAdVideo.gameObject.SetActive(false); } } } UIHomeBase.UpdateBtnMusic(btnMusic); UpdateBtnSound(); }
void Init() { string strPrefab = "AppCommon/Prefab/Home/" + GetPrefabName(); string strPrefabDefault = "Common/Prefab/Home/UIHomeDefault"; GameObject obj = PrefabCache.main.Load(strPrefab); if (obj == null) { obj = PrefabCache.main.Load(strPrefabDefault); } uiHomePrefab = obj.GetComponent <UIHomeBase>(); }
public void OnClickBtnMusic() { bool ret = Common.GetBool(AppString.STR_KEY_BACKGROUND_MUSIC); bool value = !ret; Common.SetBool(AppString.STR_KEY_BACKGROUND_MUSIC, value); if (value) { MusicBgPlay.main.PlayMusicBg(); } else { MusicBgPlay.main.Stop(); } UIHomeBase.UpdateBtnMusic(btnMusic); }
public void UpdateBtnSound() { UIHomeBase.UpdateBtnSound(btnSound); }
public void UpdateBtnMusic() { UIHomeBase.UpdateBtnMusic(btnMusic); }