Exemple #1
0
    IEnumerator Start()
    {
        Shader.WarmupAllShaders();

        //yield return StartCoroutine(ReloadVersionInfo());

        yield return(new WaitForEndOfFrame());

        string resname = "Grammil_01";

        string filePath = "/Region/" + resname + ".assetBundles";

        //  加载.
        AssetBundleUti.OnSceneFinishLoading += AssetBundleUtiCallBack;

        //string url = ProjectSystem.StreamingAssets + filePath;
#if UNITY_IOS
        url = ProjectSystem.PrefixPlatform + Application.streamingAssetsPath + "/IOS/scene/map_haiwan_001.assetBundles";
#else
        url = "file:///F:/GitHub/VR/Tools/unityloadabscene/Resources/scene/Grammil_01.assetBundles";
#endif

        Debug.Log(url);

        if (!AssetBundleUti.GetABScene(url, resname, null, AssetBundleEditor.ABDataType.Normal))
        {
        }
    }
    IEnumerator Start()
    {
        Shader.WarmupAllShaders();

        //yield return StartCoroutine(ReloadVersionInfo());

        yield return(new WaitForEndOfFrame());

        string resname = "Grammil_01";

        string filePath = "/Region/" + resname + ".assetBundles";

        //  加载.
        AssetBundleUti.OnFinishLoading += AssetBundleUtiCallBack;

        //string url = ProjectSystem.StreamingAssets + filePath;
#if UNITY_IOS
        url = ProjectSystem.PrefixPlatform + Application.streamingAssetsPath + "/IOS/scene/map_haiwan_001.assetBundles";
#else
        url = "file:///F:/XSanguoG/WorkSpaceEnv/XSanguoScene/AssetBundle/StandaloneWindows/Grammil_01.assetBundles";
#endif

        Debug.Log(url);

        if (!AssetBundleUti.GetAB(url, resname, typeof(GameObject), AssetBundleEditor.ABDataType.Normal))
        {
        }
    }
Exemple #3
0
    protected override void MFStart()
    {
        base.MFStart();

        GameObject.DontDestroyOnLoad(gameObject);

        mUti = this;
    }
    protected override void MFStart()
    {
        base.MFStart();

        GameObject.DontDestroyOnLoad(gameObject);

        mUti = this;

    }
Exemple #5
0
    private void AssetBundleUtiCallBack(string url, string resname, bool success, string errorcode = "")
    {
        Debuger.Log("AssetBundleUtiCallBack:" + url + " " + resname + " " + success);

        if (success)
        {
            data = AssetBundleUti.GetObjectScene(url);

            Shader.WarmupAllShaders();
        }
    }
Exemple #6
0
    void OnDestroy()
    {
        Clear();

        if (_AbData != null)
        {
            AssetBundleUti.RemoveAbData(_AbData);

            _AbData = null;
        }
    }
    protected override void MFOnDestroy()
    {
        base.MFOnDestroy();

        OnSceneFinishLoading = null;

        OnFinishLoading = null;

        mUti.CleanDataByScene();

        mUti.mFactory.CleanABByScene();

        mUti.mFactory = null;

        mUti = null;
    }
Exemple #8
0
    protected override void MFOnDestroy()
    {
        base.MFOnDestroy();

        OnSceneFinishLoading = null;

        OnFinishLoading = null;

        mUti.CleanDataByScene();

        mUti.mFactory.CleanABByScene();

        mUti.mFactory = null;

        mUti = null;
    }
    private void AssetBundleUtiCallBack(string url, string resname, System.Type type, bool success, string errorcode = "")
    {
        Debuger.Log("AssetBundleUtiCallBack:" + url + " " + resname + " " + type + " " + success);

        if (success)
        {
            data = AssetBundleUti.GetObject(url, resname, type);

            Shader.WarmupAllShaders();
        }

        LightmapParam[] lmd = data.gameobject.GetComponentsInChildren <LightmapParam>(true);
        Debug.Log("LM: " + lmd.Length.ToString());
        for (int i = 0; i < lmd.Length; i++)
        {
            Renderer r = lmd[i].gameObject.GetComponent <Renderer>();
            r.gameObject.isStatic = true;
            r.lightmapIndex       = lmd[i].lightmapIndex;
            r.lightmapScaleOffset = lmd[i].lightmapScaleOffset;
        }
    }
    protected override void MFAwake()
    {
        base.MFAwake();

        mUti = this;
    }
Exemple #11
0
    public IEnumerator Release()
    {
        yield return(null);

        AssetBundleUti.CleanByScene();
    }
Exemple #12
0
    protected override void MFAwake()
    {
        base.MFAwake();

        mUti = this;
    }