Understand the `Future<Reference<T>>` pattern
mainThe Future<Reference<T>> class is the core abstraction for managing asynchronous resource loading (like Texture2D or Sprite). It combines IFuture<T> (the asynchronous operation) with Reference<T> (the resource management) to provide a unified lifecycle.
Key benefits include:
- Asynchronous Loading: Loads resources without blocking the Unity main thread.
- Lifecycle Management: Automatically releases resources to prevent memory leaks.
- Event Handling: Allows registering callbacks for success, failure, and cancellation.
- Component Binding: Automatically disposes of resources when the associated
UnityEngine.Componentis destroyed, ensuring memory is cleaned up when a GameObject is removed.