docs.unity3d.com
    显示 / 隐藏目录

    Class MarsMarkerLibrary

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

    Inheritance
    Object
    Object
    ScriptableObject
    MarsMarkerLibrary
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(String)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.ToString()
    Object.name
    Object.hideFlags
    Namespace: Unity.MARS
    Syntax
    [CreateAssetMenu(fileName = "MarsMarkerLibrary", menuName = "MARS/Marker Library", order = 1001)]
    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.

    Exceptions
    Type Condition
    IndexOutOfRangeException

    Thrown if index is not between 0 and Count - 1.

    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
    返回到顶部
    Copyright © 2023 Unity Technologies — 商标和使用条款
    • 法律条款
    • 隐私政策
    • Cookie
    • 不要出售或分享我的个人信息
    • Your Privacy Choices (Cookie Settings)