Class SynthesizedTrait
Base representation of a single property in a Synthesized MARS Object Most often you'll want to inherit from SynthesizedTrait>T< instead
Namespace: Unity.MARS.Data.Synthetic
Syntax
public abstract class SynthesizedTrait : MonoBehaviour, ISimulatable, ISynthesizedData
Properties
HasValidValue
True if the value for this trait is valid
Declaration
public virtual bool HasValidValue { get; }
Property Value
Type | Description |
---|---|
Boolean |
Implements
SynthesizedObject
The associated SynthesizedObject
Declaration
public SynthesizedObject SynthesizedObject { get; }
Property Value
Type | Description |
---|---|
SynthesizedObject |
Implements
TraitName
Declaration
public abstract string TraitName { get; }
Property Value
Type | Description |
---|---|
String |
Implements
UpdateWithTransform
Should this trait update when its transform does?
Declaration
public abstract bool UpdateWithTransform { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
AddTrait(Int32)
Called when the SynthesizedObject around this trait is being added
Declaration
public abstract void AddTrait(int dataID)
Parameters
Type | Name | Description |
---|---|---|
Int32 | dataID | The entity that will hold all of the synthesized data |
Awake()
Called by Unity when the object is first activated
Declaration
protected virtual void Awake()
OnDisable()
Called by Unity when the object is disabled
Declaration
protected virtual void OnDisable()
OnEnable()
Called by Unity when the object is enabled
Declaration
protected virtual void OnEnable()
RemoveTrait(Int32)
Called when the SynthesizedObject around this trait is being removed
Declaration
public abstract void RemoveTrait(int dataID)
Parameters
Type | Name | Description |
---|---|---|
Int32 | dataID | The entity that holds this trait |
TryAdd()
Try to add this trait to the associated SynthesizedObject
Declaration
public bool TryAdd()
Returns
Type | Description |
---|---|
Boolean | True if the trait was added successfully |
Implements
TryRemove()
Try to remove this trait from the associated SynthesizedObject
Declaration
public bool TryRemove()
Returns
Type | Description |
---|---|
Boolean | True if the trait was removed successfully |
Implements
UpdateTrait(Int32)
Called when the SynthesizedObject around this trait is being updated
Declaration
public abstract void UpdateTrait(int dataID)
Parameters
Type | Name | Description |
---|---|---|
Int32 | dataID | The entity that will hold all of the synthesized data |