diff --git a/Voile/Source/Resources/Resource.cs b/Voile/Source/Resources/Resource.cs
index b85b6c6..6b41c7b 100644
--- a/Voile/Source/Resources/Resource.cs
+++ b/Voile/Source/Resources/Resource.cs
@@ -13,11 +13,35 @@ namespace Voile
///
public readonly Guid Guid = Guid.Empty;
public bool HasValue => Guid != Guid.Empty;
- ///
- /// Retrieve a reference.
- ///
- public T Value => ResourceManager.GetResource(Guid);
+ ///
+ /// Retrieves a .
+ /// This will throw an if the resource wasn't loaded or is invalid.
+ /// You can check if resource was loaded with , or consider using .
+ ///
+ public T Value => ResourceManager.GetResource(Guid)
+ ?? throw new InvalidOperationException($"Resource with GUID {Guid} is not loaded or invalid.");
+
+ ///
+ /// Retrieves a resource or null if the resource wasn't loaded or is invalid.
+ ///
+ public T? ValueOrNull => ResourceManager.GetResource(Guid);
+
+ ///
+ /// Tries to retrieve a .
+ ///
+ /// An instance of a retrieved .
+ /// true if the resource was successfully retrieved, otherwise false.
+ public bool TryGetValue(out T? value)
+ {
+ value = ResourceManager.GetResource(Guid);
+ return value != null;
+ }
+
+ ///
+ /// Create an empty .
+ ///
+ ///
public static ResourceRef Empty()
{
return new ResourceRef(Guid.Empty);