public static T GetComponent <T>( this IAddressablesLoader <GameObject> addressablesLoader, AssetReferenceComponent <T> assetReference) where T : Component { return(addressablesLoader.GetAsset(assetReference).GetComponent <T>()); }
public static bool TryGetComponent <T>( this IAddressablesLoader <GameObject> addressablesLoader, AssetReferenceComponent <T> assetReference, out T component) where T : Component { if (addressablesLoader.TryGetAsset(assetReference, out var gameObject)) { return(gameObject.TryGetComponent(out component)); } component = default; return(false); }