Add this component to a platform and define its new friction or force which will be applied to any CorgiController that walks on it
More...
Add this component to a platform and define its new friction or force which will be applied to any CorgiController that walks on it
◆ ForceApplicationModes
the possible modes this surface can apply forces
Enumerator |
---|
AddForce | |
SetForce | |
◆ ApplyHorizontalForce()
virtual void MoreMountains.CorgiEngine.SurfaceModifier.ApplyHorizontalForce |
( |
SurfaceModifierTarget |
target | ) |
|
|
protectedvirtual |
This method applies horizontal forces if needed
- Parameters
-
◆ ApplyVerticalForce()
virtual void MoreMountains.CorgiEngine.SurfaceModifier.ApplyVerticalForce |
( |
SurfaceModifierTarget |
target | ) |
|
|
protectedvirtual |
This method applies vertical forces if needed
- Parameters
-
◆ Awake()
virtual void MoreMountains.CorgiEngine.SurfaceModifier.Awake |
( |
| ) |
|
|
protectedvirtual |
On awake we initialize our list of targets
◆ ForceApplicationConditionsMet()
virtual bool MoreMountains.CorgiEngine.SurfaceModifier.ForceApplicationConditionsMet |
( |
| ) |
|
|
protectedvirtual |
This method returns true if conditions to apply force are met
- Returns
◆ OnTriggerExit2D()
virtual void MoreMountains.CorgiEngine.SurfaceModifier.OnTriggerExit2D |
( |
Collider2D |
collider | ) |
|
|
protectedvirtual |
On trigger exit, we lose all reference to the controller and character
- Parameters
-
◆ OnTriggerStay2D()
virtual void MoreMountains.CorgiEngine.SurfaceModifier.OnTriggerStay2D |
( |
Collider2D |
collider | ) |
|
|
virtual |
◆ ProcessSurface()
virtual void MoreMountains.CorgiEngine.SurfaceModifier.ProcessSurface |
( |
| ) |
|
|
protectedvirtual |
A method used to go through all targets and apply force if needed
◆ Update()
virtual void MoreMountains.CorgiEngine.SurfaceModifier.Update |
( |
| ) |
|
|
protectedvirtual |
On Update, we make sure we have a controller and a live character, and if we do, we apply a force to it
◆ _character
Character MoreMountains.CorgiEngine.SurfaceModifier._character |
|
protected |
◆ _controller
◆ AddedForce
Vector2 MoreMountains.CorgiEngine.SurfaceModifier.AddedForce = Vector2.zero |
◆ ForceApplicationCooldownDuration
Vector2 MoreMountains.CorgiEngine.SurfaceModifier.ForceApplicationCooldownDuration = new Vector2(0f, 0.25f) |
the cooldown to apply (in seconds) between two force applications, on x and y forces respectively
◆ ForceApplicationMode
the chosen mode to use to apply force. Add will add to existing forces, Set will force that specific value, ignoring current forces.
◆ Friction
float MoreMountains.CorgiEngine.SurfaceModifier.Friction |
the amount of friction to apply to a CorgiController walking over this surface
◆ OnlyApplyForceIfGrounded
bool MoreMountains.CorgiEngine.SurfaceModifier.OnlyApplyForceIfGrounded = false |
if this is true, the force will only be applied if the colliding character is grounded
◆ ResetForcesOnExit
bool MoreMountains.CorgiEngine.SurfaceModifier.ResetForcesOnExit = false |
whether or not to reset forces when an object exits the surface, useful when moving inactive objects
◆ _targets
a list of all the targets currently impacted by this surface modifier
The documentation for this class was generated from the following file: