示例#1
0
        public AsyncOperationHandle LoadAssetAsync <T>(string assetName, Action <T> completeCallback, string label = "")
        {
            this.assetName = assetName;
            AsyncOperationHandle <T> handle = Addressables.LoadAssetAsync <T>(assetName);

            handle.AddCompleteCallback((result) =>
            {
                if (completeCallback != null)
                {
                    completeCallback.Invoke(result.Result);
                }
            });

            m_loadHandler = handle;

            return(handle);
        }