Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.BasicRaycast Class Reference

A simple raycast collider wrapping a standard 2D raycast. More...

Inheritance diagram for PlatformerPro.BasicRaycast:
PlatformerPro.NoAllocationRaycast PlatformerPro.NoAllocationSmartSidecast PlatformerPro.NoAllocationSmartFeetcast PlatformerPro.NoAllocationSmartHeadcast

Public Member Functions

virtual RaycastHit2D GetRaycastHit ()
 Get the first raycast hit. More...
 
virtual RaycastHit2D[] GetRaycastHits ()
 Get all raycast hits. More...
 
virtual Vector2 GetDirection ()
 Gets the direction for the raycast. More...
 

Protected Member Functions

virtual void Init ()
 Set up the raycasts. More...
 

Protected Attributes

Transform transform
 Stores the transform from which the ray position is relative to. Most collider will use the characters transform which is set on Init(). More...
 
float length
 The length of the ray. More...
 
RaycastType raycastType
 The type of raycast. More...
 
float lookAhead
 The additional length to add to the ray to "look ahead" for special conditions. More...
 
Vector2 extent
 The position the ray is cast from (relative to transform). More...
 
int layerMask
 The layer mask. More...
 

Properties

virtual bool Disabled [get, set]
 Enables or disables the collider. More...
 
virtual Transform Transform [get, set]
 Stores the transform from which the ray position is relative to. Usually the position of the character or one of the characters limbs. More...
 
virtual float Length [get, set]
 The length of the ray. More...
 
float RawLength [get]
 Gets the raw value of the length parameter. Required because smart colliders often change Length. More...
 
virtual float LookAhead [get, set]
 The additional length to add to the ray to "look ahead" for special conditions. More...
 
virtual RaycastType RaycastType [get, set]
 The type of raycast. More...
 
virtual Vector2 WorldPosition [get]
 The position the ray is cast from (relative to transform). More...
 
virtual int LayerMask [get, set]
 Gets or sets the layer mask for the collision. More...
 
virtual Vector2 Extent [get, set]
 Gets the extent of this collider relative to character position and rotation. For feet colliders the extent would be the offset to add to the character to find the bottom of the foot. More...
 
virtual Vector2 WorldExtent [get]
 Gets the extent of this collider in world space (i.e. with character transform applied). More...
 

Detailed Description

A simple raycast collider wrapping a standard 2D raycast.

Member Function Documentation

◆ GetDirection()

virtual Vector2 PlatformerPro.BasicRaycast.GetDirection ( )
virtual

Gets the direction for the raycast.

Returns
The direction.

◆ GetRaycastHit()

virtual RaycastHit2D PlatformerPro.BasicRaycast.GetRaycastHit ( )
virtual

Get the first raycast hit.

Reimplemented in PlatformerPro.NoAllocationSmartSidecast.

◆ GetRaycastHits()

virtual RaycastHit2D [] PlatformerPro.BasicRaycast.GetRaycastHits ( )
virtual

◆ Init()

virtual void PlatformerPro.BasicRaycast.Init ( )
protectedvirtual

Member Data Documentation

◆ extent

Vector2 PlatformerPro.BasicRaycast.extent
protected

The position the ray is cast from (relative to transform).

◆ layerMask

int PlatformerPro.BasicRaycast.layerMask
protected

The layer mask.

◆ length

float PlatformerPro.BasicRaycast.length
protected

The length of the ray.

◆ lookAhead

float PlatformerPro.BasicRaycast.lookAhead
protected

The additional length to add to the ray to "look ahead" for special conditions.

◆ raycastType

RaycastType PlatformerPro.BasicRaycast.raycastType
protected

The type of raycast.

◆ transform

Transform PlatformerPro.BasicRaycast.transform
protected

Stores the transform from which the ray position is relative to. Most collider will use the characters transform which is set on Init().

Property Documentation

◆ Disabled

virtual bool PlatformerPro.BasicRaycast.Disabled
getset

Enables or disables the collider.

The layer mask.

◆ Extent

virtual Vector2 PlatformerPro.BasicRaycast.Extent
getset

Gets the extent of this collider relative to character position and rotation. For feet colliders the extent would be the offset to add to the character to find the bottom of the foot.

The extent.

◆ LayerMask

virtual int PlatformerPro.BasicRaycast.LayerMask
getset

Gets or sets the layer mask for the collision.

The layer mask.

◆ Length

virtual float PlatformerPro.BasicRaycast.Length
getset

The length of the ray.

◆ LookAhead

virtual float PlatformerPro.BasicRaycast.LookAhead
getset

The additional length to add to the ray to "look ahead" for special conditions.

◆ RawLength

float PlatformerPro.BasicRaycast.RawLength
get

Gets the raw value of the length parameter. Required because smart colliders often change Length.

The length of the raw.

◆ RaycastType

virtual RaycastType PlatformerPro.BasicRaycast.RaycastType
getset

The type of raycast.

◆ Transform

virtual Transform PlatformerPro.BasicRaycast.Transform
getset

Stores the transform from which the ray position is relative to. Usually the position of the character or one of the characters limbs.

◆ WorldExtent

virtual Vector2 PlatformerPro.BasicRaycast.WorldExtent
get

Gets the extent of this collider in world space (i.e. with character transform applied).

The extent.

◆ WorldPosition

virtual Vector2 PlatformerPro.BasicRaycast.WorldPosition
get

The position the ray is cast from (relative to transform).


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