Exemple #1
0
        private async UniTask <T> HandleAddressableCreation <T>(AsyncOperationHandle <T> handle)
        {
            await handle.ToUniTask();

            if (handle.Status == AsyncOperationStatus.Succeeded)
            {
                var instance = handle.Result;
//                if (instance.GetComponent<ReleaseAddressableOnDestroy>() == false)
//                    instance.AddComponent<ReleaseAddressableOnDestroy>();
                return(instance);
            }
            else
            {
                _logger.LogError(handle.OperationException.ToString());
                return(default(T));
            }
        }