예제 #1
0
    private void LoadAssetBundle <T> (string path, Action <T> action) where T : UnityEngine.Object
    {
        if (null == monoClass)
        {
            Debug.LogError("MonoClass instance failed");
        }

        monoClass.StartCoroutine(AsyncLoadAssetBundle(path, assetbundle => {
            T t         = assetbundle.LoadAsset <T> (path);
            string name = path.Substring(path.LastIndexOf('/') + 1);
            name        = name.Remove(name.IndexOf('.'));

            Debug.Log(" assetbundle name " + name);

            if (action != null)
            {
                action(t);
            }
        }));
    }