示例#1
0
    // Use this for initialization
    void Start()
    {
        AssetBundle ab = null;

        string path = "" + Application.dataPath + "/example/bundle/item_uncompress.unity3d";

        if (FileLoader.IsExist(path))
        {
            ab = AssetBundleLoader.CreateFromFile(path);
            GameObject.Instantiate(ab.mainAsset);
        }

        path = "" + Application.dataPath + "/example/bundle/Button_uncompress.unity3d";
        if (FileLoader.IsExist(path))
        {
            ab = AssetBundleLoader.CreateFromFile(path);
            GameObject.Instantiate(ab.mainAsset);
        }

        path = "" + Application.dataPath + "/example/bundle/Terrain_uncompress.unity3d";
        if (FileLoader.IsExist(path))
        {
            ab = AssetBundleLoader.CreateFromFile(path);
            GameObject.Instantiate(ab.mainAsset);
        }
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        AssetBundle ab   = null;
        string      path = "" + Application.dataPath + "/example/bundle/combine_uncompress.unity3d";

        if (FileLoader.IsExist(path))
        {
            ab          = AssetBundleLoader.CreateFromFile(path);
            this.loader = AsyncLoader.StartLoad(ab, "item", finish_callback);
        }
    }
    private void finish_callback(object obj)
    {
        Debug.Log("Zip Finished");

        AssetBundle ab = null;

        string path = "" + Application.dataPath + "/example/ab_zip/item_uncompress.unity3d";

        if (FileLoader.IsExist(path))
        {
            ab = AssetBundleLoader.CreateFromFile(path);
            GameObject.Instantiate(ab.mainAsset);
        }

        path = "" + Application.dataPath + "/example/ab_zip/Terrain_uncompress.unity3d";
        if (FileLoader.IsExist(path))
        {
            ab = AssetBundleLoader.CreateFromFile(path);
            GameObject.Instantiate(ab.mainAsset);
        }
    }