예제 #1
0
 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();
 }
예제 #2
0
    /// <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();
    }
예제 #3
0
    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>();
    }
예제 #4
0
    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);
    }
예제 #5
0
 public void UpdateBtnSound()
 {
     UIHomeBase.UpdateBtnSound(btnSound);
 }
예제 #6
0
 public void UpdateBtnMusic()
 {
     UIHomeBase.UpdateBtnMusic(btnMusic);
 }