コード例 #1
0
        public override bool Update()
        {
            if (m_Request != null)
            {
                return(false);
            }

            LoadedAssetBundle bundle = AssetBundleLoad.GetLoadedAssetBundle(m_AssetBundleName, out m_DownloadingError);

            if (bundle != null)
            {
#if UNITY_5_3 || UNITY_5_4
                m_Request = SceneManager.LoadSceneAsync(m_LevelName, m_IsAdditive ? LoadSceneMode.Additive : LoadSceneMode.Single);
#else
                if (m_IsAdditive)
                {
                    m_Request = Application.LoadLevelAdditiveAsync(m_LevelName);
                }
                else
                {
                    m_Request = Application.LoadLevelAsync(m_LevelName);
                }
#endif
                return(false);
            }
            else
            {
                return(true);
            }
        }
コード例 #2
0
        // Returns true if more Update calls are required.
        public override bool Update()
        {
            if (m_Request != null)
            {
                return(false);
            }

            LoadedAssetBundle bundle = AssetBundleLoad.GetLoadedAssetBundle(m_AssetBundleName, out m_DownloadingError);

            if (bundle != null)
            {
                ///@TODO: When asset bundle download fails this throws an exception...
                m_Request = bundle.m_AssetBundle.LoadAssetAsync(m_AssetName, m_Type);
                return(false);
            }
            else
            {
                return(true);
            }
        }