Beispiel #1
0
    /// <summary>
    /// 场景
    /// </summary>
    /// <returns></returns>
    private IEnumerator Worker_Scene()
    {
        if (AssetBundleManager.isCanLoadLevel(m_SceneName))
        {
            double loadsceneFileTime = DateTime.Now.Ticks;

            m_AsyncOperation = AssetBundleManager.LoadLevelAsync(m_SceneName);
            while (!m_AsyncOperation.isDone)
            {
                yield return(endofframe);
            }

            yield return(endofframe);

            ImageSetting.ApplySceneImageSettingWhenAfterLoadingScene();

            InvokeSceneActiveChangeEvent(m_SceneName);
            //将摄像机的位置移到目标点.不需要移动了,现在优化了加载速度,可以了
            // Initialize.mainCam.transform.SetPosition(m_vecBornPos);
            AdvanceProgress(30);

            loadsceneFileTime  = DateTime.Now.Ticks - loadsceneFileTime;
            loadsceneFileTime *= 0.0000001f;
            Debug.Log("场景文件加载完成,耗时:" + loadsceneFileTime);
            currentLoadingTime += loadsceneFileTime;
            yield return(new WaitForSeconds(1.0f));

            currentLoadingTime++;
        }
        else
        {
            Trace.Error("scene:" + m_SceneName + " can not be loaded due to that is not in level setting");
        }
    }