C# Класс UnityPlatformer.RaycastController

Наследование: UnityEngine.MonoBehaviour
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
collisionMask UnityEngine.LayerMask
horizontalRayCount int
minDistanceToEnv float
skinWidth float
verticalRayCount int

Открытые методы

Метод Описание
CalculateRaySpacing ( ) : void

Recalculate distance between rays (horizontalRaySpacing & verticalRaySpacing)

FeetRay ( float rayLength, LayerMask mask ) : RaycastHit2D

Return RaycastHit2D of Raycasting at bottom center.

ForeachFeetRay ( float rayLength, Vector3 &velocity, RayItr itr ) : void

Iterate over all feet/vertical rays

ForeachHeadRay ( float rayLength, Vector3 &velocity, RayItr itr ) : void

Iterate over all head/vertical rays

ForeachLeftRay ( float rayLength, Vector3 &velocity, RayItr itr ) : void

Iterate over all left/horizontal rays

ForeachRightRay ( float rayLength, Vector3 &velocity, RayItr itr ) : void

Iterate over all right/horizontal rays

LeftFeetRay ( float rayLength, Vector3 velocity ) : RaycastHit2D

Return RaycastHit2D of Raycasting at bottom left.

OnEnable ( ) : void

Recalculate everything

Raycast ( Vector2 origin, Vector2 direction, float rayLength, int mask, Color color = null ) : RaycastHit2D

Call Physics2D.Raycast and Draw the ray to debug

RightFeetRay ( float rayLength, Vector3 velocity ) : RaycastHit2D

Return RaycastHit2D of Raycasting at bottom right.

UpdateInnerBounds ( ) : void

Recalculate shrinked the bounds

UpdateRaycastOrigins ( ) : void

Recalculate raycastOrigins

VerticalRay ( float directionY, int index, float rayLength, Vector3 &velocity, Color c = null ) : RaycastHit2D

Return RaycastHit2D of Raycasting at given index

Описание методов

CalculateRaySpacing() публичный Метод

Recalculate distance between rays (horizontalRaySpacing & verticalRaySpacing)
public CalculateRaySpacing ( ) : void
Результат void

FeetRay() публичный Метод

Return RaycastHit2D of Raycasting at bottom center.
public FeetRay ( float rayLength, LayerMask mask ) : RaycastHit2D
rayLength float
mask UnityEngine.LayerMask
Результат UnityEngine.RaycastHit2D

ForeachFeetRay() публичный Метод

Iterate over all feet/vertical rays
public ForeachFeetRay ( float rayLength, Vector3 &velocity, RayItr itr ) : void
rayLength float
velocity Vector3
itr RayItr
Результат void

ForeachHeadRay() публичный Метод

Iterate over all head/vertical rays
public ForeachHeadRay ( float rayLength, Vector3 &velocity, RayItr itr ) : void
rayLength float
velocity Vector3
itr RayItr
Результат void

ForeachLeftRay() публичный Метод

Iterate over all left/horizontal rays
public ForeachLeftRay ( float rayLength, Vector3 &velocity, RayItr itr ) : void
rayLength float
velocity Vector3
itr RayItr
Результат void

ForeachRightRay() публичный Метод

Iterate over all right/horizontal rays
public ForeachRightRay ( float rayLength, Vector3 &velocity, RayItr itr ) : void
rayLength float
velocity Vector3
itr RayItr
Результат void

LeftFeetRay() публичный Метод

Return RaycastHit2D of Raycasting at bottom left.
public LeftFeetRay ( float rayLength, Vector3 velocity ) : RaycastHit2D
rayLength float
velocity Vector3
Результат UnityEngine.RaycastHit2D

OnEnable() публичный Метод

Recalculate everything
public OnEnable ( ) : void
Результат void

Raycast() публичный Метод

Call Physics2D.Raycast and Draw the ray to debug
public Raycast ( Vector2 origin, Vector2 direction, float rayLength, int mask, Color color = null ) : RaycastHit2D
origin Vector2
direction Vector2
rayLength float
mask int
color Color
Результат UnityEngine.RaycastHit2D

RightFeetRay() публичный Метод

Return RaycastHit2D of Raycasting at bottom right.
public RightFeetRay ( float rayLength, Vector3 velocity ) : RaycastHit2D
rayLength float
velocity Vector3
Результат UnityEngine.RaycastHit2D

UpdateInnerBounds() публичный Метод

Recalculate shrinked the bounds
public UpdateInnerBounds ( ) : void
Результат void

UpdateRaycastOrigins() публичный Метод

Recalculate raycastOrigins
public UpdateRaycastOrigins ( ) : void
Результат void

VerticalRay() публичный Метод

Return RaycastHit2D of Raycasting at given index
public VerticalRay ( float directionY, int index, float rayLength, Vector3 &velocity, Color c = null ) : RaycastHit2D
directionY float
index int
rayLength float
velocity Vector3
c Color
Результат UnityEngine.RaycastHit2D

Описание свойств

collisionMask публичное свойство

Static geometry mask
public LayerMask,UnityEngine collisionMask
Результат UnityEngine.LayerMask

horizontalRayCount публичное свойство

How many rays to check horizontal collisions
public int horizontalRayCount
Результат int

minDistanceToEnv публичное свойство

How far from then env the Character must be. NOTE: must be less than skinWidth, to allow continuous ground contact
public float minDistanceToEnv
Результат float

skinWidth публичное свойство

Defines how far in from the edges of the collider rays are we going to cast from. NOTE: This value must be greater than minDistanceToEnv
public float skinWidth
Результат float

verticalRayCount публичное свойство

How many rays to check vertical collisions
public int verticalRayCount
Результат int