|
Corgi Engine v9.3
|
Add this zone to a trigger collider 2D and it'll let you apply the specified force to any Corgi Controller that enters it More...
Public Types | |
| enum | ForceModes { AddForce , SetForce } |
| whether to add a force to controllers inside the zone, or to set the force More... | |
| enum | ApplicationModes { TriggerEnter , TriggerStay , TriggerExit } |
| whether the force should be applied on enter, on stay or on exit. If on stay, the force will be multiplied by delta time More... | |
Public Attributes | |
| bool | AutoTriggerSetup = true |
| if this is true, the zone will force its collider to true on awake More... | |
| ApplicationModes | ApplicationMode = ApplicationModes.TriggerEnter |
| whether to add a force to controllers inside the zone, or to set the force More... | |
| ForceModes | ForceMode = ForceModes.AddForce |
| whether the force should be applied on enter, on stay or on exit. If on stay, the force will be multiplied by delta time More... | |
| Vector2 | AddedForce = Vector2.zero |
| the amount of force to add to a CorgiController walking over this surface More... | |
| Vector2 | ForceApplicationCooldownDuration = new Vector2(0f, 0.25f) |
| the cooldown to apply (in seconds) between two force applications, on x and y forces respectively More... | |
| bool | ResetForces = true |
| whether or not the zone should reset forces on the controller (on entry or exit only) More... | |
Protected Member Functions | |
| virtual void | Awake () |
| On Awake we initialize our zone More... | |
| virtual void | Initialization () |
| On init, we force our collider's trigger settings to true if needed More... | |
| virtual void | OnTriggerEnter2D (Collider2D collider) |
| When something triggers with our zone, we apply force More... | |
| virtual void | OnTriggerExit2D (Collider2D collider) |
| virtual void | OnTriggerStay2D (Collider2D collider) |
| virtual void | HandleForce (Collider2D collider) |
| Makes sure we have a controller, resets forces if needed, applies horizontal and vertical force if needed More... | |
Protected Attributes | |
| Collider2D | _collider2D |
| CorgiController | _controller |
| Vector2 | _lastForceAppliedAt = Vector2.zero |
Add this zone to a trigger collider 2D and it'll let you apply the specified force to any Corgi Controller that enters it
|
protectedvirtual |
On Awake we initialize our zone
|
protectedvirtual |
Makes sure we have a controller, resets forces if needed, applies horizontal and vertical force if needed
| collider |
|
protectedvirtual |
On init, we force our collider's trigger settings to true if needed
|
protectedvirtual |
When something triggers with our zone, we apply force
| collider |
|
protectedvirtual |
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
| Vector2 MoreMountains.CorgiEngine.ForceZone.AddedForce = Vector2.zero |
the amount of force to add to a CorgiController walking over this surface
| ApplicationModes MoreMountains.CorgiEngine.ForceZone.ApplicationMode = ApplicationModes.TriggerEnter |
whether to add a force to controllers inside the zone, or to set the force
| bool MoreMountains.CorgiEngine.ForceZone.AutoTriggerSetup = true |
if this is true, the zone will force its collider to true on awake
| Vector2 MoreMountains.CorgiEngine.ForceZone.ForceApplicationCooldownDuration = new Vector2(0f, 0.25f) |
the cooldown to apply (in seconds) between two force applications, on x and y forces respectively
| ForceModes MoreMountains.CorgiEngine.ForceZone.ForceMode = ForceModes.AddForce |
whether the force should be applied on enter, on stay or on exit. If on stay, the force will be multiplied by delta time
| bool MoreMountains.CorgiEngine.ForceZone.ResetForces = true |
whether or not the zone should reset forces on the controller (on entry or exit only)