Exemplo n.º 1
0
    public void ShowTex(string _name)
    {
        _name = FloorTextureManager.GetFileName(_name);
        if (string.IsNullOrEmpty(_name) || textureName == _name || wantTexName == _name)
        {
            return;
        }

        wantTexName = _name;
        UIDownloadTexture dt = new UIDownloadTexture();

        //检查本地是存否在
        if (FloorTextureManager.CheckExist(wantTexName))
        {
            cityFloor.RunProgress();
            dt.EndLoadLocal = EndLoad;
            StartCoroutine(dt.LoadLocal(wantTexName));
        }
        else
        {
            //从网络下载
            if (Core.Data.usrManager.UserConfig.cartoon == 1)
            {
                cityFloor.RunProgress();
                dt.EndDownload   = EndDownload;
                dt.DownloadError = DownloadError;
                StartCoroutine(dt.Download(wantTexName));
            }
            else
            {
                EndDownload(null, "");
                // cityFloor.SetTexture(null);
            }
        }
    }
Exemplo n.º 2
0
    // type = 1   L    type =2 R
    public void ShowTex(int type, string _name)
    {
        _name = FloorTextureManager.GetFileName(_name);
        if (type == 1)
        {
            if (string.IsNullOrEmpty(_name) || wantTexName_L == _name)
            {
                TweenAlpha.Begin(L_texture.gameObject, switchTexTime, 1f);

                return;
            }
            wantTexName_L = _name;
        }
        else
        {
            if (string.IsNullOrEmpty(_name) || wantTexName_R == _name)
            {
                TweenAlpha.Begin(R_texture.gameObject, switchTexTime, 1f);
                return;
            }
            wantTexName_R = _name;
        }

        UIDownloadTexture dt = new UIDownloadTexture();

        //检查本地是存否在
        if (FloorTextureManager.CheckExist(_name))
        {
            this.RunProgress();
            if (type == 1)
            {
                dt.EndLoadLocal = EndLoadLeft;
            }
            else
            {
                dt.EndLoadLocal = EndLoadRight;
            }

            StartCoroutine(dt.LoadLocal(_name));
        }
        else
        {
            //从网络下载
//            if (Core.Data.usrManager.UserConfig.cartoon == 1)
//            {
            this.RunProgress();
            if (type == 1)
            {
                dt.EndDownload   = EndDownloadLeft;
                dt.DownloadError = DownloadError_L;
            }
            else
            {
                dt.EndDownload   = EndDownloadRight;
                dt.DownloadError = DownloadError_R;
            }
            StartCoroutine(dt.Download(_name));
//            }
//            else
//            {
//                if (type == 1)
//                    EndDownloadLeft(null, "");
//                else
//                    EndDownloadRight(null, "");
//            }
        }

        Resources.UnloadUnusedAssets();
    }