public override void exit()
    {
        if (GlobalConfig.isMyDebug == true)
        {
#if !UNITY_ANDROID && !UNITY_IPHONE  //安卓
            MyTickManager.Remove(update);
#else
            MyTickManager.Remove(phoneUpdate);
#endif
        }
        else
        {
            if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
            {
                MyTickManager.Remove(phoneUpdate);
            }
            else
            {
                MyTickManager.Remove(update);
            }
        }
        if (rotateicon != null)
        {
            rotateicon.SetActive(false);
        }
        base.exit();
    }
Ejemplo n.º 2
0
    private void render()
    {
        copylist.Clear();
        copylist.InsertRange(0, list);
        float time = Time.time;

        for (int i = 0; i < copylist.Count; i++)
        {
            HandleTask task = copylist[i];
            if (task.calltime == time)
            {
                continue;
            }
            float runTime = task.calltime + task.deletime;
            if (time < runTime)
            {
                continue;
            }
            task.Do();
            //copylist.Remove(task);
            //i--;
            list.Remove(task);
        }
        if (copylist.Count == 0)
        {
            MyTickManager.Remove(render);
        }
    }
 public override void exit()
 {
     MyTickManager.Remove(update);
     inputMachine.setState(FreeState2D.NAME);
     toggleButton.onDown = false;
     template.skin.SetActive(false);
     //if (machine.nextIsCurrent == false)
     //{
     //    toggleButton.onDown = false;
     //    template.skin.SetActive(false);
     //}
     base.exit();
 }
Ejemplo n.º 4
0
    public override void exit()
    {
        //toggleButton.onDown = false;
        //UITool.SetActionFalse(optionPage.RectRotation.gameObject);

        if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
        {
            MyTickManager.Remove(phoneUpdate);
        }
        else
        {
            MyTickManager.Remove(update);
        }
        base.exit();
    }
Ejemplo n.º 5
0
 public override void exit()
 {
     toggleButton.onDown = false;
     UITool.SetActionFalse(obj);
     mainPageContr.CloseInput();
     view2D.selectGoodsdisedWalldata = null;
     if (machine.nextIsCurrent == false)
     {
         RefreshView();
     }
     optionsPage.inputUnit.onClick.RemoveListener(onOpenInput);
     optionsPage.ok.onClick.RemoveListener(Ok);
     optionsPage.cancel.onClick.RemoveListener(Cancel);
     MyTickManager.Remove(update);
     base.exit();
 }
Ejemplo n.º 6
0
    public void Exit()
    {
        if (GlobalConfig.isMyDebug == true)
        {
#if !UNITY_ANDROID && !UNITY_IPHONE  //安卓
            if (needUpdate == true)
            {
                MyTickManager.Remove(mUpdate);
            }
            exitNotPhone();
#else
            if (needUpdate == true)
            {
                MyTickManager.Remove(mPhoneUpdate);
            }
            exitPhone();
#endif
        }
        else
        {
            if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
            {
                if (needUpdate == true)
                {
                    MyTickManager.Remove(mPhoneUpdate);
                }
                exitPhone();
            }
            else
            {
                if (needUpdate == true)
                {
                    MyTickManager.Remove(mUpdate);
                }
                exitNotPhone();
            }
        }

        exit();
    }
    public override void exit()
    {
        machine.selectGoods3DState.onhandle = false;
        if (GlobalConfig.isMyDebug == true)
        {
#if !UNITY_ANDROID && !UNITY_IPHONE  //安卓
            MyTickManager.Remove(update);
#else
            MyTickManager.Remove(phoneUpdate);
#endif
        }
        else
        {
            if (Application.platform != RuntimePlatform.Android && Application.platform != RuntimePlatform.IPhonePlayer)
            {
                MyTickManager.Remove(update);
            }
            else
            {
                MyTickManager.Remove(phoneUpdate);
            }
        }
        base.exit();
    }
Ejemplo n.º 8
0
    private IEnumerator load(object[] arg1)
    {
        //加载成功 但是加载到的数据不对
        bool   loadedIsWrong = false;
        string path          = url;

        path = path.Replace("midea-products.oss-cn-shanghai.aliyuncs.com/", "pms.3dshome.net/");
        Debug.LogWarning("OutterLoad:" + path);
        www = new WWW(path);

        if (checkProgress)
        {
            MyTickManager.Add(Progress);
        }
        yield return(www);

        //yield return new WaitForSeconds(2);//模拟慢网速
        if (checkProgress)
        {
            MyTickManager.Remove(Progress);
        }
        //if (www == null)
        //{
        //    state = SimpleLoadedState.Failed;
        //    loadedData = null;
        //    string message = string.Format("加载文件失败:{0}", url);
        //    Debug.Log(message);
        //}
        //else {
        if (string.IsNullOrEmpty(www.error))
        {
            state = SimpleLoadedState.Success;
            switch (type)
            {
            case SimpleLoadDataType.prefabAssetBundle:

                //string realName = System.IO.Path.GetFileNameWithoutExtension(url);
                AssetBundle bundle = www.assetBundle;
                if (bundle != null)
                {
                    UnityEngine.Object[] objs = bundle.LoadAllAssets();
                    for (int i = 0; i < objs.Length; i++)
                    {
                        if (objs[i].GetType() == typeof(GameObject))
                        {
                            if (objs[i].name == modelName)
                            {
                                GameObject data = objs[i] as GameObject;
                                data.name = uri;
                                if (OnLoadprefabBeforClone != null)
                                {
                                    OnLoadprefabBeforClone(data, bringData);
                                }
                                if (justLoad == false)
                                {
                                    ResourcesPool.PrefabData prefab = resourcePool.addPrefab(httpUrl, data);
                                    if (canceled == false && justEndReturn == false)
                                    {
                                        loadedData = prefab.GetNew();
                                    }
                                }
                                //loadedData = objs[i];
                                //resourcePool.addPrefab(url, loadedData);
                            }
                        }
                    }
                    if (localHas == false && string.IsNullOrEmpty(uri) == false)
                    {
                        if (cacheManager != null)
                        {
                            cacheManager.AddCache(httpUrl, www.bytes);
                        }
                    }
                    if (justLoad == false)
                    {
                        bundle.Unload(false);
                    }
                    else
                    {
                        bundle.Unload(true);
                    }
                }
                else
                {
                    loadedIsWrong = true;
                    Debug.LogError("加载到的资源不是AssetBundle!path = " + www.url);
                }
                break;

            case SimpleLoadDataType.texture2D:
                if (localHas == false && string.IsNullOrEmpty(uri) == false)
                {
                    if (cacheManager != null)
                    {
                        cacheManager.AddCache(httpUrl, www.bytes);
                    }
                }
                if (www.assetBundle != null)
                {
                    if (justLoad == false)
                    {
                        loadedData = www.assetBundle.mainAsset as Texture2D;;
                        resourcePool.addTexture(httpUrl, loadedData);
                        www.assetBundle.Unload(false);
                    }
                    else
                    {
                        www.assetBundle.Unload(true);
                    }
                }
                else
                {
                    if (justLoad == false)
                    {
                        loadedData = www.texture;
                        resourcePool.addTexture(httpUrl, loadedData);
                    }
                }
                break;

            case SimpleLoadDataType.Json:
                string json  = System.Text.Encoding.UTF8.GetString(www.bytes);
                int    index = json.IndexOf("{");
                if (index == -1)
                {
                    index = json.IndexOf("[");
                }
                if (index > 0)
                {
                    json = json.Substring(index);
                }
                //同一个Json可能会变化 不记录上次的 因为有可能是过时的
                //if(localHas == false && string.IsNullOrEmpty(uri) == false) SaveToLocal(www.bytes);
                if (justLoad == false)
                {
                    loadedData = json;
                }
                break;

            case SimpleLoadDataType.Byte:
            default:
                loadedData = null;
                string message = string.Format("加载文件类型:{0} 失败:", type);
                Debug.Log(message);
                break;
            }
        }
        else
        {
            state      = SimpleLoadedState.Failed;
            loadedData = null;
            string message = string.Format("加载文件失败:{0} Error:{1}", www.url, www.error);
            Debug.LogWarning(message);
        }
        www.Dispose();
        //Debug.LogWarning("OnLoaded");
        if (loadedIsWrong == false)//没加载到资源 或者 加载到且正确
        {
            OnLoaded();
        }
        else
        {
            //加载资源且错误 等于加载失败
            this.state = SimpleLoadedState.Failed;
            LoadNext();
            EndOnly();
            resourcePool.LoadErrorData(this);
        }
    }
 private void Close()
 {
     template.skin.SetActive(false);
     MyTickManager.Remove(update);
 }
 new public void Exit()
 {
     MyTickManager.Remove(update);
     exit();
 }