DistanceBasedUpdateRateModifier Class

Summary

A FlexiMotion.Modifiers.FlexiMotionModifier which modifies the FlexiMotion.FlexiMotionRuntime.UpdatesPerSecond based on distance to a target object.
Assembly
FlexiMotion.dll
Namespace
FlexiMotion.Modifiers
Interfaces
Base Types
graph BT Type-->Base0["FlexiMotionModifier"] click Base0 "/flexi-motion/api/FlexiMotion.Modifiers/FlexiMotionModifier" Base0-->Base1["MonoBehaviour"] Type-.->Interface0["IFlexiMotionModifier"] click Interface0 "/flexi-motion/api/FlexiMotion.Modifiers/IFlexiMotionModifier" Type-.->Interface1["IOnValidate"] click Interface1 "/flexi-motion/api/FlexiMotion/IOnValidate" Type["DistanceBasedUpdateRateModifier"] class Type type-node

Syntax

[AddComponentMenu(FMStrings.ModifiersMenuPrefix + "Distance Based Update Rate Modifier")]
[HelpURL(FMStrings.DocsURLs.ModifiersAPIDocumentation + "/" + nameof(DistanceBasedUpdateRateModifier))]
[DefaultExecutionOrder(-1000)]
public class DistanceBasedUpdateRateModifier : FlexiMotionModifier, IFlexiMotionModifier, 
    IOnValidate

Attributes

Type Description
AddComponentMenu
HelpURLAttribute
DefaultExecutionOrder

Fields

Name Constant Value Summary
TargetFieldName _Target
The name of the serialized backing field of FlexiMotion.Modifiers.FlexiMotionModifier.Target.
Inherited from FlexiMotionModifier
static

Properties

Name Value Summary
DeltaTime float
The FlexiMotion.FlexiMotionRuntime.DeltaTime.
Inherited from FlexiMotionModifier
DistanceTo Transform
The object used to calculate the distance.
FarRange float
When the distance is farther than this value, the FlexiMotion.Modifiers.FlexiMotionModifier.Target will be disabled.
MinimumUpdateRateMultiplyer float
As the distance approaches the FlexiMotion.Modifiers.DistanceBasedUpdateRateModifier.FarRange, the FlexiMotion.FlexiMotionRuntime.UpdatesPerSecond will approach the FlexiMotion.FlexiMotionDefinition.UpdatesPerSecond multiplied by this value.
NearRange float
When the distance is closer than this value, the full FlexiMotion.FlexiMotionRuntime.UpdatesPerSecond will be used.
Target FlexiMotionComponent
Inherited from FlexiMotionModifier

Methods

Name Value Summary
CalculateUpdatesPerSecond(float) float
Calculates the number of updates per second for the given `distance`.
Disable(JobModifierGroup) bool
Registers this modifier in the given FlexiMotion.Modifiers.JobModifierGroup.
Enable(JobModifierGroup) void
Registers this modifier in the given FlexiMotion.Modifiers.JobModifierGroup.
Inherited from FlexiMotionModifier
GetUsedBones() IEnumerable<Transform>
Returns the objects that are used by this modifier.
Inherited from FlexiMotionModifier
LateUpdate() void
Updates the FlexiMotion.FlexiMotionRuntime.UpdatesPerSecond based on the distance.
OnDisable() void
Calls FlexiMotion.Modifiers.FlexiMotionModifier.Disable(FlexiMotion.Modifiers.JobModifierGroup) if the FlexiMotion.Modifiers.FlexiMotionModifier.Target is set.
Inherited from FlexiMotionModifier
OnEnable() void
Calls FlexiMotion.Modifiers.FlexiMotionModifier.Enable(FlexiMotion.Modifiers.JobModifierGroup) if the FlexiMotion.Modifiers.FlexiMotionModifier.Target is set.
Inherited from FlexiMotionModifier
OnValidate() void
Tries to find a FlexiMotion.Modifiers.FlexiMotionModifier.Target if none was assigned.
Reset() void
Sets the UnityEngine.Camera.main as the default FlexiMotion.Modifiers.DistanceBasedUpdateRateModifier.DistanceTo.

Extension Methods

Name Value Summary
LogTemp<DistanceBasedUpdateRateModifier>(Object) T
Debug.Log(message, context) with an [System.ObsoleteAttribute] warning so you remember to remove any calls.
SafeGetHashCode<DistanceBasedUpdateRateModifier>() int
Uses System.Collections.Generic.EqualityComparer`1.Default to get a hash code.