using UnityEngine; namespace Rive.Components { /// /// Base class for providing atlas packing strategies to the AtlasRenderTargetStrategy. /// Allows customization of how render targets are packed into the atlas texture. /// public abstract class RenderTargetAtlasPackingProvider : MonoBehaviour { /// /// Interface defining the required methods for an atlas packing strategy. /// Implementations determine how rectangles are arranged within the atlas texture. /// public interface IPackingStrategy { /// /// Initializes the packing strategy with the given dimensions. If already initialized, resets the packing area and clears any existing rectangles. /// /// The width of the packing area /// The height of the packing area void Initialize(int width, int height); /// /// Attempts to insert a rectangle of the given dimensions into the packing area. /// /// The width of the rectangle to insert /// The height of the rectangle to insert /// The resulting position and dimensions if insertion succeeds /// True if insertion succeeded, false if there was no room bool TryInsert(int width, int height, out RectInt rect); } /// /// The packing strategy to use when packing the render targets into the atlas. /// public abstract IPackingStrategy PackingStrategy { get; } } }