using System; namespace UnityEngine.XR.ARSubsystems { /// /// The runtime representation of a . /// Some libraries are mutable; see . /// public abstract class RuntimeReferenceImageLibrary : IReferenceImageLibrary { /// /// Get the at the given . /// /// The index. public XRReferenceImage this[int index] { get { if (index < 0) throw new ArgumentOutOfRangeException(nameof(index), index, $"{nameof(index)} must be greater than or equal to zero."); if (index >= count) throw new ArgumentOutOfRangeException(nameof(index), index, $"{nameof(index)} must be less than count ({count})."); return GetReferenceImageAt(index); } } /// /// The number of reference images contained in this library. /// public abstract int count { get; } /// /// Derived methods should return the at the given . /// The has already been validated to be within the range [0..]. /// /// The index of the reference image to get. /// A that represents the reference image at index . protected abstract XRReferenceImage GetReferenceImageAt(int index); } }