Ejemplo n.º 1
0
        public static void LoadAsync(string abName, string assetName, Action <AudioClip> callback)
        {
            if (string.IsNullOrEmpty(abName) || string.IsNullOrEmpty(assetName))
            {
                Debug.LogError("abName or assetName is null!!!");
                if (callback != null)
                {
                    callback(null);
                }
                return;
            }

            Action <AssetLoadData> tCallBack = null;

            if (callback != null)
            {
                tCallBack = (data) =>
                {
                    callback(data.mAsset as AudioClip);
                };
            }

            HAudioCilp res = Get <HAudioCilp>(abName, assetName, AssetType.eAudioClip);

            res.StartLoad(false, false, false, tCallBack);
        }
Ejemplo n.º 2
0
        public static AudioClip Load(string abName, string assetName)
        {
            if (string.IsNullOrEmpty(abName) || string.IsNullOrEmpty(assetName))
            {
                Debug.LogError("abName or assetName is null!!!");
                return(null);
            }

            HAudioCilp res = Get <HAudioCilp>(abName, assetName, AssetType.eAudioClip);

            res.StartLoad(true, false, false, null);
            return(res.AssetData.mAsset as AudioClip);
        }
Ejemplo n.º 3
0
 //协程加载贴图
 public AsyncRequest LoadAudioClipCoRequest(string abName, string assetName)
 {
     return(HAudioCilp.LoadCoRequest(abName, assetName));
 }
Ejemplo n.º 4
0
 //同步加载音频
 public AudioClip LoadAudioClip(string abName, string assetName)
 {
     return(HAudioCilp.Load(abName, assetName));
 }
Ejemplo n.º 5
0
 //异步加载音频
 public void LoadAudioClipAsync(string abName, string assetName, Action <AudioClip> callback)
 {
     HAudioCilp.LoadAsync(abName, assetName, callback);
 }