![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
Base class for triggers. This handles the character assignment logic. Although you don't need to extend your triggers from this class it may be useful to ensure compatability with other classes in the kit. More...
Public Attributes | |
TriggerTarget[] | receivers |
The Targets that receive the triggers actions. More... | |
bool | actAsSwitch |
If true this trigger will have an on/off state and the trigger actions will only be sent if they match the on/off state. More... | |
bool | startSwitchAsOn |
If true the switch starts in the on state. More... | |
bool | sendSwitchEventsOnLoad = true |
bool | oneShot |
Fire this trigger once only then disable? More... | |
float | autoLeaveTime |
Time after enter in which leave will be automatically triggered. Ignored if 0 or smaller. More... | |
MonoBehaviour | requiredComponent |
If this is not null (none) then the required MonoBehaviour must be active and enabled before trigger will activate. More... | |
bool | useDefaultPersistence |
Does this Item get persistence defaults form the Game manager? More... | |
![]() | |
bool | enablePersistence |
Should we enable persistence? More... | |
string | guid = System.Guid.NewGuid().ToString() |
Unique ID for this object. You shoulnd't need to edit this, use editor debug mode if you must. More... | |
GameObject | target |
GameObject to apply persitence settings to, defaults to self. More... | |
PersistableObjectType | persistenceImplementation |
How do we implement the persistence settings. More... | |
bool | defaultStateIsDisabled |
If true then the obejct starts disabled. More... | |
string | spawnedObjectName |
If this item was spawned then save the name of the prefab here. More... | |
Static Public Attributes | |
static Color | GizmoColor = new Color (1, 0.64f, 0, 0.5f) |
Default color to use when draing Trigger gizmos. More... | |
Protected Member Functions | |
virtual void | OnTriggerEntered (Character character, bool onOffState) |
Raises the trigger entered event. More... | |
virtual void | OnTriggerExited (Character character) |
Raises the trigger exited event. More... | |
override void | PostInit () |
Initialise the sensor. More... | |
virtual bool | EnterTrigger (Character character) |
Character entered proximity. More... | |
virtual void | DoEnterTrigger (Character character) |
Do the trigger work More... | |
virtual void | SavePersistenceData () |
Gets the extra persistence data which is used to save platform state. NOTE: Generally you should override ExtraPersistenceData to save a different set of data. More... | |
override void | ApplyCustomPersistence (PersistableObjectData data) |
Custom persistable implementation. Override to customise. More... | |
virtual bool | ConditionsMet (Character character) |
Are the conditions for firing this trigger met? More... | |
virtual bool | ExitConditionsMet (Character character) |
Are the conditions for exiting trigger met. More... | |
virtual IEnumerator | DoLeaveAfterDelay (Character character, float delay) |
Does the autoleave action. Cancelled by the leave being triggerd. More... | |
virtual bool | LeaveTrigger (Character character) |
Character leaves the trigger. More... | |
virtual void | DoLeaveTrigger (Character character) |
Does the actual work for leavinga trigger. More... | |
![]() | |
virtual void | SetPersistenceDefaults () |
Sets the persistence defaults. More... | |
virtual void | ProcessState () |
Processes the persisted state. More... | |
virtual void | ApplyExtraPersistenceData (PersistableObjectData data) |
Apply any extra data. This differs from custom persistence, as custom persistence must control both data and ctivation state. More... | |
Protected Attributes | |
IEnumerator | autoLeaveRoutine |
Stores the autoleave routine. More... | |
AdditionalCondition[] | conditions |
Cached list of all additional conditions. More... | |
bool | onOffState |
Are we on or off? true = on. More... | |
Static Protected Attributes | |
static bool | isLoaded |
Have we reloaded characters. More... | |
Properties | |
bool | SwitchState [get] |
![]() | |
virtual string | ExtraPersistenceData [get] |
Gets the extra persistence data. More... | |
![]() | |
virtual string | Header [get] |
Gets the header string used to describe the component. More... | |
virtual string | DocLink [get] |
Gets a link to documentation site. More... | |
virtual string | VideoLink [get] |
Gets a link to a youtube video. More... | |
virtual string | Deprecated [get] |
If non-null this component is deprecated. The string shows a message indicating how it should be replaced. More... | |
Events | |
System.EventHandler< CharacterEventArgs > | TriggerEntered |
Event for trigger enter. More... | |
System.EventHandler< CharacterEventArgs > | TriggerExited |
Event for trigger leave. More... | |
Additional Inherited Members | |
![]() | |
void | SetPersistenceState (bool state) |
Sets the persistence state. More... | |
void | SetPersistenceState (bool state, string extraPersistenceData) |
Sets the persistence state, overriding extra persistence data More... | |
![]() | |
virtual void | Validate (PlatformerProMonoBehaviour myTarget) |
Override this method if you want to provide custom validation. The actual code should be surrounded by the if UNITY_EDITOR / endif directive. More... | |
Base class for triggers. This handles the character assignment logic. Although you don't need to extend your triggers from this class it may be useful to ensure compatability with other classes in the kit.
|
protectedvirtual |
Custom persistable implementation. Override to customise.
data | Data. |
Reimplemented from PlatformerPro.PersistableObject.
|
protectedvirtual |
Are the conditions for firing this trigger met?
character | Character. |
|
protectedvirtual |
Do the trigger work
character | Character. |
|
protectedvirtual |
Does the autoleave action. Cancelled by the leave being triggerd.
character | Character. |
delay | Delay. |
|
protectedvirtual |
Does the actual work for leavinga trigger.
character | Character. |
|
protectedvirtual |
Character entered proximity.
character | Character. NOTE: This can be null if triggered by something that is not a character. |
Reimplemented in PlatformerPro.ConditionTrigger.
|
protectedvirtual |
Are the conditions for exiting trigger met.
true
, if conditions are met, false
otherwise.character | Character. |
|
protectedvirtual |
Character leaves the trigger.
character | Character. NOTE: This can be null if triggered by something that is not a character. |
Reimplemented in PlatformerPro.ConditionTrigger.
|
protectedvirtual |
Raises the trigger entered event.
character | Character. |
|
protectedvirtual |
Raises the trigger exited event.
character | Character. |
|
protectedvirtual |
Initialise the sensor.
Reimplemented from PlatformerPro.PersistableObject.
|
protectedvirtual |
Gets the extra persistence data which is used to save platform state. NOTE: Generally you should override ExtraPersistenceData to save a different set of data.
bool PlatformerPro.Trigger.actAsSwitch |
If true this trigger will have an on/off state and the trigger actions will only be sent if they match the on/off state.
|
protected |
Stores the autoleave routine.
float PlatformerPro.Trigger.autoLeaveTime |
Time after enter in which leave will be automatically triggered. Ignored if 0 or smaller.
|
protected |
Cached list of all additional conditions.
|
static |
Default color to use when draing Trigger gizmos.
|
staticprotected |
Have we reloaded characters.
bool PlatformerPro.Trigger.oneShot |
Fire this trigger once only then disable?
|
protected |
Are we on or off? true = on.
TriggerTarget [] PlatformerPro.Trigger.receivers |
The Targets that receive the triggers actions.
MonoBehaviour PlatformerPro.Trigger.requiredComponent |
If this is not null (none) then the required MonoBehaviour must be active and enabled before trigger will activate.
bool PlatformerPro.Trigger.sendSwitchEventsOnLoad = true |
bool PlatformerPro.Trigger.startSwitchAsOn |
If true the switch starts in the on state.
bool PlatformerPro.Trigger.useDefaultPersistence |
Does this Item get persistence defaults form the Game manager?
|
get |
System.EventHandler<CharacterEventArgs> PlatformerPro.Trigger.TriggerEntered |
Event for trigger enter.
System.EventHandler<CharacterEventArgs> PlatformerPro.Trigger.TriggerExited |
Event for trigger leave.