Class MarsMarkerLibrary
A MarsMarkerLibrary is a collection of MarsMarkerDefinition to search for in
the physical environment when marker tracking is enabled.
Inheritance
MarsMarkerLibrary
Syntax
public class MarsMarkerLibrary : ScriptableObject, IMRMarkerLibrary
Properties
Count
The number of markers in the library.
Declaration
public int Count { get; }
Property Value
DefaultMarkerDefinitionLabel
Declaration
public static string DefaultMarkerDefinitionLabel { get; }
Property Value
Item[Int32]
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
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
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
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
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
SetTexture(Int32, Texture2D)
Declaration
public void SetTexture(int index, Texture2D texture)
Parameters
Type |
Name |
Description |
Int32 |
index |
|
Texture2D |
texture |
|