Beispiel #1
0
    /// <summary>
    /// 资源初始化结束
    /// </summary>
    public void OnResourceInited()
    {
        LuaManager.CreateInstance();
        string url   = LuaUtil.GetRelativePath();
        int    index = url.LastIndexOf("/");

        AssetManager.BaseDownloadingURL = url.Substring(0, index);
        m_openLoginUI = true;

        InitManager();
    }
Beispiel #2
0
    private IEnumerator Initialize(System.Action Complete)
    {
        // With this code, when in-editor or using a development builds: Always use the AssetBundle Server
        // (This is very dependent on the production workflow of the project.
        //  Another approach would be to make this configurable in the standalone player.)
//#if DEVELOPMENT_BUILD || UNITY_EDITOR
//        AssetManager.SetDevelopmentAssetBundleServer();
//#else
//       AssetManager.SetSourceAssetBundleURL(ResourcePath.GetBaseURL());
//        // Use the following code if AssetBundles are embedded in the project for example via StreamingAssets folder etc:
//        AssetBundleManager.SetSourceAssetBundleURL(Application.dataPath + "/");
//        // Or customize the URL based on your deployment or configuration
//        //AssetBundleManager.SetSourceAssetBundleURL("http://www.MyWebsite/MyAssetBundles");
//#endif
        if (!Define.UseLoacalRes)
        {
            AssetManager.SetDevelopmentAssetBundleServer();
        }
        else
        {
            AssetManager.SetSourceAssetBundleURL(ResourcePath.GetBaseURL());
        }

        if (!Define.UpdateMode)
        {
            LuaManager.CreateInstance();
        }

        //Initialize AssetBundleManifest which loads the AssetBundleManifest object.
        var request = AssetManager.Initialize(gameObject);

        if (request != null)
        {
            yield return(StartCoroutine(request));
        }
        if (null != Complete)
        {
            Complete();
        }
    }