Defines a relationship among one or more Lemmings. Can be used to calculate positions, rotations, and derived values.
More...
Inherits ScriptableObject, and Lemmings.ILemmingRelationship.
|
| List<(string LemmingName, string Role)> | GetRoleLemmingPairs () |
| | This is a publicly accessible list to access the Lemming Roles and Pairs.
|
| ILemmingConverter | ToConverter () |
| | This is used to define the Converter, which can be called to make data conversions for flexible output. example: [relationship].Converter.ToIntRange(0, 20)
|
| LemmingDatum | SetValue () |
| | This sets the Datum, which holds the type-agnostic value for this relationship. You can override this to set the value through another means.
|
|
void | InvalidateCache () |
| | Whenever changes are made to the relationship, such as OnValidation (for the inspector), in the Lemming Shepherd, or the UI, this needs to be called. This sets it up so that the entire cached Info struct is rebuilt and not simply updated with dynamic values.
|
|
void | UpdateFromInfo (LemmingRelationshipInfo info) |
|
void | OnMetricChanged () |
|
void | CompareStatus () |
|
string | GetMetricDescription () |
|
AnimationCurve | GetActiveCurve () |
| | Returns the appropriate AnimationCurve to use based on the selected curve type. If curveType is 'Custom', returns the user-defined curve. Otherwise, returns a predefined curve from the curve library.
|
|
void | SyncRolesFromHerd () |
| | Syncs each role-to-name assignment with its resolved LemmingReference.
|
|
void | SyncReferencesFromNames () |
|
|
string | ID |
| | This section is to create the unique identifier for the relationship. (example) "Make Selection".
|
|
string | description |
| | The description will automatically map to the User Interface by default and so it can be used to provide valuable information about the functionality to users that might be interested in remapping it. In many ways this is about establishing a place to communicate the goal of a relationship internally but primarilly for users. (example) "This relationship is used to select items in the scene triggers when the value is smaller than the minimum threshold.
By default it is set up as a finger pinch, so that if your index finger and thumb are very close to each other, you select an item.
You can remap it any way that you like, but be mindful that it is something that provides an on or off result,
so some metrics will be more reliable than others.".
|
|
bool | useInputSystem |
| | Lemmings includes a virtual input device. If you want to use unity's input system and access events through it, this needs to be true.
|
|
LemmingHerdSnapshot | Herd |
| | The Herd Snapshot is a scriptable object (asset) that acts as the ground truth for which lemmings are available to be a part of a specific relationship and to populate the enums that allow selecting options. The Snapshot also have functions to help locate and resolve game objects.
|
|
FamilyType | familyType = FamilyType.Single |
| | This enum sets the type of family this relationship embodies. Essentially determining the number of members included.
|
|
SingleMetric | singleMetric |
|
CoupleMetric | coupleMetric |
|
ThroupleMetric | throupleMetric |
|
GroupMetric | groupMetric |
|
float | min = 0f |
| | Each relationship has a minimum and maximum threshold for establishing Normalization and its boolean status This is the minimum value.
|
|
float | max = 1f |
| | Each relationship has a minimum and maximum threshold for establishing Normalization and its boolean status This is the maximum value.
|
|
LemmingCurveType | curveType = LemmingCurveType.Linear |
| | Enum specifying the type of curve to apply to this relationship's output. If set to 'Custom', the user-defined AnimationCurve will be used instead.
|
|
AnimationCurve | customCurve = AnimationCurve.Linear(0, 0, 1, 1) |
| | The custom curve used when curveType is set to 'Custom'. This curve will be applied to the normalized value before output.
|
|
LemmingRelationshipProxy | proxy |
|
Dictionary< string, string > | roleToName = new() |
| | This dictionary is used to confirm and hold the role of a particular lemming in a relationship. Used for display purposes.
|
|
Dictionary< string, LemmingReference > | roleToReference = new() |
| | This dictionary is used to associate the specific Lemming Reference to the role that it plays in the relationship.
|
|
List< LemmingReference > | selectedReferences = new() |
| | Used to hold the translation from the string value of the lemming selected into a more stable Lemming Reference.
|
|
List< string > | selectedNames = new() |
| | The enum used to select which lemmings to use gets converted into a string so that it can be more broadly used. This holds those strings in a list so that they can be converted into Lemming References.
|
|
|
void | ValidateMetricFamilyMatch () |
| | Ensures the Metric enum matches the specified Family. Throws if not. This is used as a fail safe at run time to fail quickly in case of a bad configuration. ValidateMetricFamily is used while in editor mode to prevent mismatches in the first place.
|
|
|
object | ActiveMode [get] |
| | This is the mode switcher that changes the enum of available options based on the family type. It is boxed as an object so that it can be safely called and implemented while retaining flexibility.
|
| Enum | Metric [get] |
| | This hold the current metric being used and its associated family type.
|
|
LemmingRelationSetting | Settings [get] |
|
LemmingDatum | Datum [get] |
| | The derived datum based on the relationship logic.
|
| int | Count [get] |
| | Number of valid members in the relationship.
|
| float | Min [get, set] |
| | Public access to the Min. Set ensures that the value is less than Max.
|
| float | Max [get, set] |
| | Public access to the Max. Set ensures that the value is greater than Min.
|
| LemmingCurveType | CurveType [get] |
| | Read-only accessor for the selected Curve Type.
|
|
AnimationCurve | Curve [get] |
| | This is the read-only pull for the active Curve, the active curve is selected from the enum 'curveType'. Most of the curves are predefined, except for the custom curve, which is draw in the inspector.
|
| AnimationCurve | CustomCurve [get] |
| | This is the read only version of the custom curve that users draw in the inspector.
|
|
RelationshipStatus | Status [get] |
| | This is the Read-Only value for the boolean state of the relationship, showing if it is over, under, or within its min/max range.
|
|
LemmingRelationshipInfo | Info [get] |
| | This is the Info struct for the relationship that holds its important data. Developers can call for any relevant relationship information from this and it should provide it at minimal compute cost. The idea is for the information to mostly live in a cached state, with only the dynamic values updating per frame.
|
|
List< GameObject > | Members [get] |
| List< LemmingReference > | References [get] |
| | This is the authoritative list of Lemmings, includes all the fallback support and metadata through the reference struct.
|
|
ref LemmingRelationshipInfo | CachedInfo [get] |
| | This is the public reference to a copy of the cached info. This can be used to pull the info struct out of a relationship and use it elsewhere to make modifications that do not immediately update the original.
|
|
ILemmingConverter | Converter [get] |
|
LemmingValueType | Type [get] |
| FamilyType | Family [get, set] |
|
LemmingRelation | MyRelation [get] |
| | This initiates the Lemming struct for the appropriate family type and relevant enum. Depending on the number of lemmings in a relationship, the metrics are calculated differently. This ensures that the correct metric options are listed for the number of tracked items.
|
|
|
Action | Updated = ()=>{} |
| | This is called when the Info Struct is updated.
|
|
Action< LemmingDatum > | OnDatumUpdated |
| | Fired every time SetValue is called and the Datum is refreshed. Subscribers can pull Raw/Normalized/Curved/Over/Under/InRange from the new LemmingDatum.
|
|
Action | OnUnder |
|
Action | OnOver |
|
Action | OnInRange |
|
Action | Updated |
| | Fire this whenever ToDatum() or any core parameter changes.
|
|
|
LemmingRelationSetting | _settings |
|
FamilyType | _lastFamilyType |
| | Cache for detecting changes in family type.
|
|
Enum | _lastMetric |
| | Cache for detecting changes in metric type.
|
|
LemmingRelationshipInfo | _cachedInfo |
| | This is the info struct for the relationship that is cached in order to be more lightweight.
|
|
bool | _hasInitializedCache = false |
| | This is the boolean flag used to determine whether or not the cache needs to be rebuilt. Changes made to the relationship settings should set this to false using InvalidateCache
|
|
List< GameObject > | _membersCache |
|
LemmingHerdSnapshot | lastHerd |
| | Used to confirm if the herd snapshot has been altered.
|
|
RelationshipStatus | _lastStatus |
Defines a relationship among one or more Lemmings. Can be used to calculate positions, rotations, and derived values.
◆ GetRoleLemmingPairs()
| List<(string LemmingName, string Role)> Lemmings.LemmingRelationship.GetRoleLemmingPairs |
( |
| ) |
|
|
inline |
This is a publicly accessible list to access the Lemming Roles and Pairs.
- Returns
- List of the Lemming Name and its role in the relationship
◆ RehydrateSettings()
Copies only the relevant fields from a previous LemmingRelationSetting into a freshly created one, based on the currently selected family and metric . This ensures that only appropriate values are preserved while eliminating stale data from earlier metrics.
- Parameters
-
| fresh | A newly created, empty settings instance to populate. |
| prior | The existing settings object that may contain user-authored values. |
| family | The family type of the relationship (e.g., Single, Couple, Throuple, Group). |
| metric | The selected metric for which relevant settings should be restored. |
◆ SetValue()
This sets the Datum, which holds the type-agnostic value for this relationship. You can override this to set the value through another means.
Implements Lemmings.ILemmingRelationship.
◆ ToConverter()
This is used to define the Converter, which can be called to make data conversions for flexible output. example: [relationship].Converter.ToIntRange(0, 20)
Implements Lemmings.ILemmingRelationship.
◆ Count
| int Lemmings.LemmingRelationship.Count |
|
get |
◆ CurveType
◆ CustomCurve
| AnimationCurve Lemmings.LemmingRelationship.CustomCurve |
|
get |
◆ Family
◆ Max
| float Lemmings.LemmingRelationship.Max |
|
getset |
◆ Metric
| Enum Lemmings.LemmingRelationship.Metric |
|
get |
◆ Min
| float Lemmings.LemmingRelationship.Min |
|
getset |
◆ References
The documentation for this class was generated from the following file:
- Assets/Lemmings/Scripts/ScriptableObjects/LemmingRelationship.cs