Loading...
Searching...
No Matches
PixelCrushers.LoveHate.CanSeeAdvanced Class Reference

Add to a GameObject that has a FactionMember. More...

Inheritance diagram for PixelCrushers.LoveHate.CanSeeAdvanced:
Collaboration diagram for PixelCrushers.LoveHate.CanSeeAdvanced:

Public Member Functions

virtual bool CanSee (FactionMember actor, Dimension dimension)
 

Public Attributes

FieldOfView[] fieldsOfView = new FieldOfView[0]
 The sensor's fields of view (FOVs).
 
float[] extraRaycastHeights = new float[0]
 Extra heights at which to run raycast checks in addition to the target's local origin.
 
LayerMask seeThroughLayer
 
FactionMember factionMember
 
Transform raySource
 
Dimension dimension = Dimension.Is3D
 
bool hasCheckedEver = false
 
Vector3 lastPointChecked
 
string lastPointGizmoName = string.Empty
 

Static Public Attributes

static readonly FieldOfView CentralFOV = new FieldOfView(45f, 120f, 20f, new Color(1, 1, 1, 0.3f))
 
static readonly FieldOfView WideFOV = new FieldOfView(120f, 120f, 15f, new Color(1, 1, 1, 0.2f))
 
static readonly FieldOfView PeripheralFOV = new FieldOfView(180f, 120f, 5f, new Color(1, 1, 1, 0.1f))
 

Protected Member Functions

virtual void Reset ()
 
virtual void Awake ()
 
virtual void Start ()
 
virtual bool IsInFOVs (Transform target, Dimension dimension)
 
virtual bool IsInLineOfSight (Transform target, Dimension dimension)
 
virtual bool RaycastHitTarget (Transform target, Vector3 rayStart, Vector3 rayEnd, Dimension dimension)
 
bool IsInLayerMask (int layer, LayerMask layerMask)
 

Protected Attributes

RaycastHit2D[] hits2D = new RaycastHit2D[MaxHits]
 

Static Protected Attributes

const int MaxHits = 20
 

Detailed Description

Add to a GameObject that has a FactionMember.

Provides a more advanced implementation for FactionMember.CanSee that offers multiple fields of view and visual debug inforomation in the Scene view.

Member Function Documentation

◆ Awake()

virtual void PixelCrushers.LoveHate.CanSeeAdvanced.Awake ( )
inlineprotectedvirtual

◆ CanSee()

virtual bool PixelCrushers.LoveHate.CanSeeAdvanced.CanSee ( FactionMember  actor,
Dimension  dimension 
)
inlinevirtual

◆ IsInFOVs()

virtual bool PixelCrushers.LoveHate.CanSeeAdvanced.IsInFOVs ( Transform  target,
Dimension  dimension 
)
inlineprotectedvirtual

◆ IsInLayerMask()

bool PixelCrushers.LoveHate.CanSeeAdvanced.IsInLayerMask ( int  layer,
LayerMask  layerMask 
)
inlineprotected

◆ IsInLineOfSight()

virtual bool PixelCrushers.LoveHate.CanSeeAdvanced.IsInLineOfSight ( Transform  target,
Dimension  dimension 
)
inlineprotectedvirtual

◆ RaycastHitTarget()

virtual bool PixelCrushers.LoveHate.CanSeeAdvanced.RaycastHitTarget ( Transform  target,
Vector3  rayStart,
Vector3  rayEnd,
Dimension  dimension 
)
inlineprotectedvirtual

◆ Reset()

virtual void PixelCrushers.LoveHate.CanSeeAdvanced.Reset ( )
inlineprotectedvirtual

◆ Start()

virtual void PixelCrushers.LoveHate.CanSeeAdvanced.Start ( )
inlineprotectedvirtual

Member Data Documentation

◆ CentralFOV

readonly FieldOfView PixelCrushers.LoveHate.CanSeeAdvanced.CentralFOV = new FieldOfView(45f, 120f, 20f, new Color(1, 1, 1, 0.3f))
static

◆ dimension

Dimension PixelCrushers.LoveHate.CanSeeAdvanced.dimension = Dimension.Is3D

◆ extraRaycastHeights

float [] PixelCrushers.LoveHate.CanSeeAdvanced.extraRaycastHeights = new float[0]

Extra heights at which to run raycast checks in addition to the target's local origin.

When trying to see a humanoid, you might want to run raycasts to its feet, abdomen, and head. The feet and abdomen might be blocked by a low wall, but the head could be visible above it.

◆ factionMember

FactionMember PixelCrushers.LoveHate.CanSeeAdvanced.factionMember

◆ fieldsOfView

FieldOfView [] PixelCrushers.LoveHate.CanSeeAdvanced.fieldsOfView = new FieldOfView[0]

The sensor's fields of view (FOVs).

◆ hasCheckedEver

bool PixelCrushers.LoveHate.CanSeeAdvanced.hasCheckedEver = false

◆ hits2D

RaycastHit2D [] PixelCrushers.LoveHate.CanSeeAdvanced.hits2D = new RaycastHit2D[MaxHits]
protected

◆ lastPointChecked

Vector3 PixelCrushers.LoveHate.CanSeeAdvanced.lastPointChecked

◆ lastPointGizmoName

string PixelCrushers.LoveHate.CanSeeAdvanced.lastPointGizmoName = string.Empty

◆ MaxHits

const int PixelCrushers.LoveHate.CanSeeAdvanced.MaxHits = 20
staticprotected

◆ PeripheralFOV

readonly FieldOfView PixelCrushers.LoveHate.CanSeeAdvanced.PeripheralFOV = new FieldOfView(180f, 120f, 5f, new Color(1, 1, 1, 0.1f))
static

◆ raySource

Transform PixelCrushers.LoveHate.CanSeeAdvanced.raySource

◆ seeThroughLayer

LayerMask PixelCrushers.LoveHate.CanSeeAdvanced.seeThroughLayer

◆ WideFOV

readonly FieldOfView PixelCrushers.LoveHate.CanSeeAdvanced.WideFOV = new FieldOfView(120f, 120f, 15f, new Color(1, 1, 1, 0.2f))
static

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