Summary
TimeAgent implementation adding a generic way to persist custom properties.
This component is made to make things simple, but it should not be used in production if performances are critical. Because Reflection is used to get custom properties values and it will always be way more slower than direct access.
To get the same result with no performance impact, use TimeAgent UnityEvent or extend TimeAgent with your own class
- Namespace
- RedGirafeGames
.Agamotto .Scripts .Runtime .Agents - Base Types
-
- MonoBehaviour
- TimeAgent
graph BT
Type-->Base0["TimeAgent"]
click Base0 "/api/RedGirafeGames.Agamotto.Scripts.Runtime.Agents/TimeAgent"
Base0-->Base1["MonoBehaviour"]
Type["GenericTimeAgent"]
class Type type-node
Syntax
[RequireComponent(typeof(Transform))]
[AddComponentMenu("Agamotto/Generic Time Agent")]
public class GenericTimeAgent : TimeAgent
Attributes
Type | Description |
---|---|
RequireComponent | |
AddComponentMenu |
Fields
Name | Constant Value | Summary |
---|---|---|
ActiveDataId | GameObjectActiveSelf |
GameObject.activeSelf id to persist in the TimeStone
Inherited from TimeAgent
static
|
agentAnimator |
The
Animator component to persist. If not defined, automatically get gameObject's Animator
Inherited from TimeAgent
|
|
agentRigidbody |
Cached value of Rigidbody
Inherited from TimeAgent
|
|
Angular |
RigidbodyAngularVelocity |
Rigidbody.angularVelocity id to persist in the TimeStone
Inherited from TimeAgent
static
|
Animator |
Animator#StateHash |
Animator 's state hash where DataIdUidToken is replaced with a unique identifier using GetUniqueDataId(string, int)
Inherited from TimeAgent
static
|
Animator |
Animator#InTransition |
Animator 's state transition status where DataIdUidToken is replaced with a unique identifier using GetUniqueDataId(string, int)
Inherited from TimeAgent
static
|
Animator |
Animator#LayerWeight |
Animator 's state layer weight where DataIdUidToken is replaced with a unique identifier using GetUniqueDataId(string, int)
Inherited from TimeAgent
static
|
Animator |
Animator#StateNormalizedTime |
Animator state normalized time where
DataIdUidToken is replaced with the layer num using GetAnimatorDataIdWithLayer
Inherited from TimeAgent
static
|
Animator |
Animator#TransitionDuration |
Animator 's transition duration where DataIdUidToken is replaced with a unique identifier using GetUniqueDataId(string, int)
Inherited from TimeAgent
static
|
Animator |
Animator#TransitionNextHash |
Animator 's transition next hash where DataIdUidToken is replaced with a unique identifier using GetUniqueDataId(string, int)
Inherited from TimeAgent
static
|
Animator |
Animator#TransitionNextNormalizedTime |
Animator 's transition next normalized time where DataIdUidToken is replaced with a unique identifier using GetUniqueDataId(string, int)
Inherited from TimeAgent
static
|
Animator |
Animator#TransitionNormalizedTime |
Animator 's transition normalized time where DataIdUidToken is replaced with a unique identifier using GetUniqueDataId(string, int)
Inherited from TimeAgent
static
|
applyColorToClone |
Applies
cloneColor to the clone material
Inherited from TimeAgent
|
|
apply |
If true,
cloneColor and cloneMaterial are applied on clone's children recursively
Inherited from TimeAgent
|
|
auto |
The list of the ComponentNames persisted, must be synchronized with
autoPersistedDataIdMemberNames
|
|
auto |
The list of the MemberNames persisted, must be synchronized with
autoPersistedDataIdComponentTypes
|
|
cloneColor |
The color applied to the clone if
applyColorToClone is true
Inherited from TimeAgent
|
|
cloneMaterial |
The material applied to the clone.
If null, no material is applied.
Inherited from TimeAgent
|
|
guid |
Unique ID shared by the original TimeAgent and the cloned TimeAgent used by simulations
Inherited from TimeAgent
|
|
hidePolicy |
How the simulation clone is hidden (or not)
Inherited from TimeAgent
|
|
logDebug |
Log all messages
Inherited from TimeAgent
|
|
parseChildren |
TimeAgents will be searched in children on TimeStone initialization
Inherited from TimeAgent
|
|
Particle |
ParticleSystem#Particles |
ParticleSystem particles where
DataIdUidToken is replaced with a unique identifier using GetParticleSystemUniqueDataId
Inherited from TimeAgent
static
|
Particle |
ParticleSystem#PlaybackState |
ParticleSystem playback state where
DataIdUidToken is replaced with a unique identifier using GetParticleSystemUniqueDataId
Inherited from TimeAgent
static
|
Particle |
ParticleSystem#Trails |
ParticleSystem trails where
DataIdUidToken is replaced with a unique identifier using GetParticleSystemUniqueDataId
Inherited from TimeAgent
static
|
persistActive |
Persist
GameObject.activeSelf in TimeStone
Inherited from TimeAgent
|
|
persistAnimator |
Persist
Animator 's state in TimeStone
Inherited from TimeAgent
|
|
persist |
Persist
Animator 's transitions between states.
Inherited from TimeAgent
|
|
persistParticles |
Inherited from TimeAgent
|
|
persistParticlesList |
The list of
ParticleSystem to persist. If empty, automatically get gameObject's ParticleSystem
Inherited from TimeAgent
|
|
persistPosition |
Persist
Transform.position in TimeStone
Inherited from TimeAgent
|
|
persistRotation |
Persist
Transform.rotation in TimeStone
Inherited from TimeAgent
|
|
persistScale |
Persist
Transform.localScale in TimeStone
Inherited from TimeAgent
|
|
persistVelocity |
Inherited from TimeAgent
|
|
PositionDataId | TransformPosition |
Transform.position id to persist in the TimeStone
Inherited from TimeAgent
static
|
PositionLocalDataId | TransformLocalPosition |
Transform.localPosition id to persist in the TimeStone
Inherited from TimeAgent
static
|
RotationDataId | TransformRotation |
Transform.rotation id to persist in the TimeStone
Inherited from TimeAgent
static
|
RotationLocalDataId | TransformLocalRotation |
Transform.localRotation id to persist in the TimeStone
Inherited from TimeAgent
static
|
ScaleDataId | TransformScale |
Transform.localScale id to persist in the TimeStone
Inherited from TimeAgent
static
|
search |
Search for
ParticleSystem in children
Inherited from TimeAgent
|
|
simulation |
The simulation events receive policy.
In most of the cases, original time agents won't have any use of these events, so setting the policy
to
CloneOnly there is no need in the code to check for IsClone
Inherited from TimeAgent
|
|
useLocalPosition |
Inherited from TimeAgent
|
|
useLocalRotation |
Inherited from TimeAgent
|
|
VelocityDataId | RigidbodyVelocity |
Rigidbody.velocity id to persist in the TimeStone
Inherited from TimeAgent
static
|
Properties
Methods
Name | Value | Summary |
---|---|---|
AddCustomDataId |
bool |
Add a custom data to be persisted to the component's list.
No security is made to check if the component and its member really exist
|
Apply |
void |
Applies the data cached on simulation initialization
Inherited from TimeAgent
|
Awake |
void |
Inherited from TimeAgent
|
Cache |
void |
Cache GameObject's components by type
|
Cache |
void |
Cache initialization data from the Original object to apply them on the cloned Simulation object when Simulation starts
Inherited from TimeAgent
|
Clear |
void |
Clear automatically persisted components and members
|
ClonedForSimulation |
void |
ClonedForSimulation callback called by timeStone
Inherited from TimeAgent
|
GetClone |
GameObject |
Cloning method called by the TimeStone when creating a simulation scene.
You can override it to modify the way the object is cloned.
Inherited from TimeAgent
|
GetComponentByType |
Component |
Get GameObject's component by its type
|
InitTimeAgentsList |
void |
InitTimeAgentsList callback called by timeStone
Inherited from TimeAgent
|
Persist |
void |
Perists GameObject's data
Inherited from TimeAgent
|
PersistRigidbodyData |
void |
Persists Rigidbody's data
Inherited from TimeAgent
|
PersistTick |
void |
Override of
PersistTick(TimeStone, TimeStone.TimeTickOrigin, float) to add the persistence of custom generic data using Reflection
|
PersistTransformData |
void |
Persists Transform's data
Inherited from TimeAgent
|
RemoveCustomDataId |
bool |
Remove a custom data from automatic persistence.
|
SetDataTick |
void |
Override of
SetDataTick(TimeStone, int) to apply custom generic properties using Reflection
|
SetDataTime |
void |
Set data from the stone but using time
Inherited from TimeAgent
|
SimulationComplete |
void |
SimulationComplete callback called by timeStone
Inherited from TimeAgent
|
Simulation |
void |
SimulationUpdate callback called by timeStone
Inherited from TimeAgent
|
SimulationLateUpdate |
void |
SimulationLateUpdate callback called by timeStone
Inherited from TimeAgent
|
SimulationSceneReady |
void |
SimulationSceneReady callback
|
SimulationStart |
void |
SimulationStart callback called by timeStone
Inherited from TimeAgent
|
SimulationUpdate |
void |
SimulationUpdate callback called by timeStone.
Inherited from TimeAgent
|
TimeLineChange |
void |
TimeLineChange callback called by timeStone
Inherited from TimeAgent
|