Lemmings
Remappable Gestures For Unity
Loading...
Searching...
No Matches
Lemmings.Lemming Class Reference

Component representing a tracked Lemming attached to a GameObject. More...

Inherits MonoBehaviour, and Lemmings.ILemming.

Public Member Functions

void UpdateSmoothedVelocity ()
float GetConfidence ()
 Returns the confidence score for this Lemming. TODO: This function should check for dropped tracking over a period of time and reflect that.

Data Fields

GameObject objectToTrack
 This is a field for a gameObject that you wish the Lemming to track. It is generally easier to simply let the Lemming be the main object that is used to define relationships but in cases where a hierarchy is particularly complex, or it makes the project cleaner, you can add an object to this field and it will be used to evaluate Lemming Relationships.

Properties

Vector3 SmoothedVelocity [get, private set]
Vector3 Velocity [get]
GameObject matchTarget [get]
 Read-Only accessor for the object this Lemming is matching.
bool followingObject [get]
 True if the Lemming is tracking an external GameObject (via objectToTrack). False if it is using its own transform as the tracked reference.
string Name [get]
 The assigned name of the Lemming. This inherits from a serialized private field.
string name [get]
 This is a backup in case name is called with lowercase letters.
string DefaultName [get]
 When the name is never entered manually and the lemming is accessed remotely, it leads to a null result, this is a backup that uses the name of the gameobject to resolve.
GameObject Source [get]
 The GameObject this Lemming refers to. Pulls the gameobject this script is a component of.
float Confidence [get]
 The confidence value (0 to 1) for this Lemming. Placeholder implementation until dynamic evaluation is implemented. TODO: The confidence should be updatable by users testing the tracking of potential features.
bool HasValidShepherd [get]
 Returns true if this Lemming is under a valid LemmingContainer in the hierarchy.

Private Member Functions

void Awake ()
void Update ()
 If this is matching a tracked object then update these values each frame.
void Start ()
void OnDestroy ()
void RegisterWithShepherd ()
 This is the registration event with the Lemming Shepherd TODO: There may be additional check required here, such as ensuring that HasValidShepherd is true.

Private Attributes

string referenceName
float confidence = 1f
int velocitySampleSize = 10
readonly Queue< Vector3 > velocitySamples = new()
Vector3 lastPosition
float lastTime
Rigidbody rb

Detailed Description

Component representing a tracked Lemming attached to a GameObject.

Member Function Documentation

◆ GetConfidence()

float Lemmings.Lemming.GetConfidence ( )
inline

Returns the confidence score for this Lemming. TODO: This function should check for dropped tracking over a period of time and reflect that.

Returns
A float between 0 and 1 representing confidence.

Implements Lemmings.ILemming.

Property Documentation

◆ Name

string Lemmings.Lemming.Name
get

The assigned name of the Lemming. This inherits from a serialized private field.

Implements Lemmings.ILemming.

◆ Source

GameObject Lemmings.Lemming.Source
get

The GameObject this Lemming refers to. Pulls the gameobject this script is a component of.

Implements Lemmings.ILemming.


The documentation for this class was generated from the following file:
  • Assets/Lemmings/Scripts/Classes/Lemming.cs