Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
Loading...
Searching...
No Matches
AC.DetectHotspots Class Reference
Inheritance diagram for AC.DetectHotspots:

Public Types

enum  HotspotGatherMode { TriggerDetection , CustomScript }

Public Member Functions

void AddHotspot (Hotspot hotspot)
 Adds a Hotspot to the internal collection of detected Hotspots, provided gatherMode = GatherMode.CustomScript.
void RemoveHotspot (Hotspot hotspot)
 Removes a Hotspot from the internal collection of detected Hotspots, provided gatherMode = GatherMode.CustomScript.
void _Update ()
Hotspot[] GetAllDetectedHotspots ()
 Gets all Hotspots found within the object's Trigger collider.
Hotspot GetSelected ()
 Gets the currently-active Hotspot.
void SetSelected (Hotspot _hotspot)
 Sets the currently-active Hotspot. The Hotspot must already be included in the component's internal record of detected Hotspot.
void ForceRemoveHotspot (Hotspot _hotspot)
 Removes a Hotspot from the script's internal record of detected Hotspots.
bool IsHotspotInTrigger (Hotspot hotspot)
 Checks if a specific Hotspot is within its volume.
void HighlightAll ()

Public Attributes

HotspotGatherMode gatherMode = HotspotGatherMode.TriggerDetection

Protected Member Functions

void Start ()
void OnEnable ()
void OnDisable ()
void OnTriggerStay (Collider other)
void OnTriggerStay2D (Collider2D other)
void OnTriggerExit (Collider other)
void OnInitialiseScene ()
bool IsLayerCorrect (int layerInt, bool distantToo=false)
void OnTriggerExit2D (Collider2D other)
void CycleHotspots (bool goRight)
bool IsActivePlayer ()

Protected Attributes

Hotspot nearestHotspot
int selected = 0
List< Hotspothotspots = new List<Hotspot>()
int hotspotLayerInt
int distantHotspotLayerInt

Properties

Hotspot NearestHotspot [get]

Detailed Description

Used to only allow Hotspots within a given volume to be selectable. Attach this as a child object to your Player prefab, and assign it as your Hotspot detector child - be sure to set "hotspot detection" to Player Vicinity in SettingsManager.

Member Function Documentation

◆ _Update()

void AC.DetectHotspots._Update ( )

Detects Hotspots in its vicinity. This is public so that it can be called by StateHandler every frame.

◆ AddHotspot()

void AC.DetectHotspots.AddHotspot ( Hotspot hotspot)

Adds a Hotspot to the internal collection of detected Hotspots, provided gatherMode = GatherMode.CustomScript.

Parameters
hotspotThe Hotspot to add

◆ ForceRemoveHotspot()

void AC.DetectHotspots.ForceRemoveHotspot ( Hotspot _hotspot)

Removes a Hotspot from the script's internal record of detected Hotspots.

Parameters
_hotspotThe Hotspot to forget

◆ GetAllDetectedHotspots()

Hotspot[] AC.DetectHotspots.GetAllDetectedHotspots ( )

Gets all Hotspots found within the object's Trigger collider.

Returns
All Hotspots found within the object's Trigger collider.

◆ GetSelected()

Hotspot AC.DetectHotspots.GetSelected ( )

Gets the currently-active Hotspot.

Returns
The currently active Hotspot.

◆ HighlightAll()

void AC.DetectHotspots.HighlightAll ( )

Highlights all Hotspots within its volume.

◆ IsHotspotInTrigger()

bool AC.DetectHotspots.IsHotspotInTrigger ( Hotspot hotspot)

Checks if a specific Hotspot is within its volume.

Parameters
hotspotThe Hotspot to check for
Returns
True if the Hotspot is within the Collider volume

◆ RemoveHotspot()

void AC.DetectHotspots.RemoveHotspot ( Hotspot hotspot)

Removes a Hotspot from the internal collection of detected Hotspots, provided gatherMode = GatherMode.CustomScript.

Parameters
hotspotThe Hotspot to remove

◆ SetSelected()

void AC.DetectHotspots.SetSelected ( Hotspot _hotspot)

Sets the currently-active Hotspot. The Hotspot must already be included in the component's internal record of detected Hotspot.

Parameters
_hotspotThe Hotspot to make active

Property Documentation

◆ NearestHotspot

Hotspot AC.DetectHotspots.NearestHotspot
get

The Hotspot nearest to the centre of the detector