docs.unity3d.com
    Show / Hide Table of Contents

    Class MarsMarkerLibrary

    A MarsMarkerLibrary is a collection of MarsMarkerDefinition to search for in the physical environment when marker tracking is enabled.

    Inheritance
    Object
    MarsMarkerLibrary
    Namespace: Unity.MARS.Data
    Syntax
    public class MarsMarkerLibrary : ScriptableObject, IMRMarkerLibrary

    Properties

    Count

    The number of markers in the library.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    Int32

    DefaultMarkerDefinitionLabel

    Declaration
    public static string DefaultMarkerDefinitionLabel { get; }
    Property Value
    Type Description
    String

    Item[Int32]

    Get an marker by index.

    Declaration
    public MarsMarkerDefinition this[int index] { get; }
    Parameters
    Type Name Description
    Int32 index

    The index of the marker in the library. Must be between 0 and count - 1.

    Property Value
    Type Description
    MarsMarkerDefinition

    The MarsMarkerDefinition at index.

    Methods

    CreateAndAdd()

    Creates an empty MarsMarkerDefinition and adds it to the library. The new marker is inserted at the end of the list of markers.

    Declaration
    public MarsMarkerDefinition CreateAndAdd()
    Returns
    Type Description
    MarsMarkerDefinition

    The MarsMarkerDefinition created and added.

    GetEnumerator()

    Gets an enumerator which can be used to iterate over the markers in this library.

    Declaration
    public List<MarsMarkerDefinition>.Enumerator GetEnumerator()
    Returns
    Type Description
    List.Enumerator<>

    An IEnumerator which can be used to iterate over the markers in the library.

    Examples

    This examples iterates over the MarsMarkerDefinitions contained in the library.

    var markerLibrary = ...
    foreach (var markerDefinition in markerLibrary)
    Debug.LogFormat("Marker label: {0}", markerDefinition.Label);

    IndexOf(MarsMarkerDefinition)

    Get the index of MarsMarkerDefinition in the marker library.

    Declaration
    public int IndexOf(MarsMarkerDefinition markerDefinition)
    Parameters
    Type Name Description
    MarsMarkerDefinition markerDefinition

    The MarsMarkerDefinition to find.

    Returns
    Type Description
    Int32

    The zero-based index of the MarsMarkerDefinition, or -1 if not found.

    RemoveAt(Int32)

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    Int32 index

    SaveMarkerLibrary()

    Declaration
    public void SaveMarkerLibrary()

    SetGuid(Int32, Guid)

    Declaration
    public void SetGuid(int index, Guid markerGuid)
    Parameters
    Type Name Description
    Int32 index
    Guid markerGuid

    SetLabel(Int32, String)

    Declaration
    public void SetLabel(int index, string markerLabel)
    Parameters
    Type Name Description
    Int32 index
    String markerLabel

    SetSize(Int32, Vector2)

    Declaration
    public void SetSize(int index, Vector2 size)
    Parameters
    Type Name Description
    Int32 index
    Vector2 size

    SetSpecifySize(Int32, Boolean)

    Declaration
    public void SetSpecifySize(int index, bool specifySize)
    Parameters
    Type Name Description
    Int32 index
    Boolean specifySize

    SetTexture(Int32, Texture2D)

    Declaration
    public void SetTexture(int index, Texture2D texture)
    Parameters
    Type Name Description
    Int32 index
    Texture2D texture
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023