C# Class UnityPlatformer.Liquid

Inheritance: UnityEngine.MonoBehaviour
Mostra file Open project: llafuente/unity-platformer

Public Properties

Property Type Description
buoyancy UnityEngine.Vector2
buoyancySurfaceFactor float
surfaceOffset float
viscosity float

Public Methods

Method Description
DistanceToSurface ( Character character, float offset ) : float

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

GetTop ( ) : Vector3

Get real-world-coordinates water top

IsBelowSurface ( Character character, float offset ) : bool

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

IsSubmerged ( Character character ) : bool

Return if given character is complety submerged

OnTriggerEnter2D ( Collider2D o ) : void

if a Hitbox(EnterAreas) enter -> enterArea

OnTriggerExit2D ( Collider2D o ) : void

if a Hitbox(EnterAreas) enter -> exitArea

Start ( ) : void

Get BoxCollider2D

Private Methods

Method Description
OnDrawGizmos ( ) : void

Method Details

DistanceToSurface() public method

Get the distance between liquid surface and character(feet) + offset
public DistanceToSurface ( Character character, float offset ) : float
character Character
offset float
return float

GetTop() public method

Get real-world-coordinates water top
public GetTop ( ) : Vector3
return UnityEngine.Vector3

IsBelowSurface() public method

Return if given character(feet) + offset is below liquid surface
public IsBelowSurface ( Character character, float offset ) : bool
character Character
offset float
return bool

IsSubmerged() public method

Return if given character is complety submerged
public IsSubmerged ( Character character ) : bool
character Character
return bool

OnTriggerEnter2D() public method

if a Hitbox(EnterAreas) enter -> enterArea
public OnTriggerEnter2D ( Collider2D o ) : void
o UnityEngine.Collider2D
return void

OnTriggerExit2D() public method

if a Hitbox(EnterAreas) enter -> exitArea
public OnTriggerExit2D ( Collider2D o ) : void
o UnityEngine.Collider2D
return void

Start() public method

Get BoxCollider2D
public Start ( ) : void
return void

Property Details

buoyancy public_oe property

Velocity applied to the Character NOTE need to oppose gravity, so greater in other direction
public Vector2,UnityEngine buoyancy
return UnityEngine.Vector2

buoyancySurfaceFactor public_oe property

public float buoyancySurfaceFactor
return float

surfaceOffset public_oe property

Surface offset, used to adjust how much the character can submerge.
public float surfaceOffset
return float

viscosity public_oe property

Viscosity affect Character Liquid movement
public float viscosity
return float