C# Class ScreenRaycaster, swip3

Inheritance: MonoBehaviour
Afficher le fichier Open project: unit9/swip3 Class Usage Examples

Méthodes publiques

Свойство Type Description
Cameras Camera[]
IgnoreLayerMask LayerMask
RayThickness float
VisualizeRaycasts bool

Méthodes publiques

Méthode Description
Raycast ( Vector2 screenPos, RaycastHit &hit ) : bool
Start ( ) : void

Private Methods

Méthode Description
Raycast ( Camera cam, Vector2 screenPos, RaycastHit &hit ) : bool

Method Details

Raycast() public méthode

public Raycast ( Vector2 screenPos, RaycastHit &hit ) : bool
screenPos Vector2
hit UnityEngine.RaycastHit
Résultat bool

Start() public méthode

public Start ( ) : void
Résultat void

Property Details

Cameras public_oe property

List of cameras to use for each raycast. Each camera will be considered in the order specified in this list, and the Raycast method will continue until a hit is detected.
public Camera[] Cameras
Résultat Camera[]

IgnoreLayerMask public_oe property

Layers to ignore when raycasting
public LayerMask IgnoreLayerMask
Résultat LayerMask

RayThickness public_oe property

Thickness of the ray. Setting rayThickness to 0 will use a normal Physics.Raycast() Setting rayThickness to > 0 will use Physics.SphereCast() of radius equal to half rayThickness ** IMPORTANT NOTE ** According to Unity's documentation, Physics.SphereCast() doesn't work on colliders setup as triggers
public float RayThickness
Résultat float

VisualizeRaycasts public_oe property

Property used while in the editor only. Toggles the visualization of the raycasts as red lines for misses, and green lines for hits (visible in scene view only)
public bool VisualizeRaycasts
Résultat bool