platformer
Public Member Functions | Public Attributes | List of all members
UnityPlatformer.Liquid Class Reference

Liquid tile. More...

Inheritance diagram for UnityPlatformer.Liquid:
UnityPlatformer.Physhic2DMonoBehaviour

Public Member Functions

override void Start ()
 Get BoxCollider2D More...
 
virtual Vector3 GetTop ()
 Get real-world-coordinates water top More...
 
bool IsBelowSurface (Character character, float offset)
 Return if given character(feet) + offset is below liquid surface More...
 
bool IsSubmerged (Character character)
 Return if given character is complety submerged More...
 
float DistanceToSurface (Character character, float offset)
 Get the distance between liquid surface and character(feet) + offset More...
 
virtual void OnTriggerEnter2D (Collider2D o)
 if a Hitbox(EnterAreas) enter -> enterArea More...
 
virtual void OnTriggerExit2D (Collider2D o)
 if a Hitbox(EnterAreas) enter -> exitArea More...
 

Public Attributes

float viscosity = 1
 Viscosity affect Character Liquid movement More...
 
float surfaceOffset = 0
 Surface offset, used to adjust how much the character can submerge. More...
 
Vector2 buoyancy = Vector2.zero
 Velocity applied to the Character NOTE need to oppose gravity, so greater in other direction More...
 
float buoyancySurfaceFactor = 0.5f
 How much buoyancy apply when close to surface More...
 
- Public Attributes inherited from UnityPlatformer.Physhic2DMonoBehaviour
bool debug = false
 Display collider as flat color More...
 

Detailed Description

Liquid tile.

Member Function Documentation

◆ DistanceToSurface()

float UnityPlatformer.Liquid.DistanceToSurface ( Character  character,
float  offset 
)
inline

Get the distance between liquid surface and character(feet) + offset

◆ GetTop()

virtual Vector3 UnityPlatformer.Liquid.GetTop ( )
inlinevirtual

Get real-world-coordinates water top

◆ IsBelowSurface()

bool UnityPlatformer.Liquid.IsBelowSurface ( Character  character,
float  offset 
)
inline

Return if given character(feet) + offset is below liquid surface

◆ IsSubmerged()

bool UnityPlatformer.Liquid.IsSubmerged ( Character  character)
inline

Return if given character is complety submerged

◆ OnTriggerEnter2D()

virtual void UnityPlatformer.Liquid.OnTriggerEnter2D ( Collider2D  o)
inlinevirtual

if a Hitbox(EnterAreas) enter -> enterArea

◆ OnTriggerExit2D()

virtual void UnityPlatformer.Liquid.OnTriggerExit2D ( Collider2D  o)
inlinevirtual

if a Hitbox(EnterAreas) enter -> exitArea

◆ Start()

override void UnityPlatformer.Liquid.Start ( )
inlinevirtual

Get BoxCollider2D

Reimplemented from UnityPlatformer.Physhic2DMonoBehaviour.

Member Data Documentation

◆ buoyancy

Vector2 UnityPlatformer.Liquid.buoyancy = Vector2.zero

Velocity applied to the Character NOTE need to oppose gravity, so greater in other direction

◆ buoyancySurfaceFactor

float UnityPlatformer.Liquid.buoyancySurfaceFactor = 0.5f

How much buoyancy apply when close to surface

◆ surfaceOffset

float UnityPlatformer.Liquid.surfaceOffset = 0

Surface offset, used to adjust how much the character can submerge.

◆ viscosity

float UnityPlatformer.Liquid.viscosity = 1

Viscosity affect Character Liquid movement


The documentation for this class was generated from the following file: