Adventure Creator  1.76.2
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.AC_Trigger Class Reference
Inheritance diagram for AC.AC_Trigger:
AC.ActionList AC.iActionListAssetReferencer AC.IItemReferencer AC.IDocumentReferencer AC.IObjectiveReferencer AC.IMenuReferencer AC.IVariableReferencer

Classes

class  PositionDetectObject
 

Public Member Functions

void _Update ()
 
bool IsOn ()
 Checks if the Trigger is enabled. More...
 
void TurnOn ()
 
void TurnOff ()
 
override void Interact ()
 
void AddObjectToDetect (GameObject _gameObject)
 Registers an object as one that can be detected by the Trigger, provided that detectionMethod = TriggerDetectionMethod.TransformPosition More...
 
void RemoveObjectToDetect (GameObject _gameObject)
 Registers an object as one that cancanot be detected by the Trigger, provided that detectionMethod = TriggerDetectionMethod.TransformPosition More...
 
- Public Member Functions inherited from AC.ActionList
void Initialise ()
 
void RunFromIndex (int index)
 Runs the Actions from a set point. More...
 
void Interact (int i, bool addToSkipQueue)
 Runs the Actions from a set point. More...
 
void Skip ()
 
void Skip (int i)
 Runs the Actions instantly, from a set point. More...
 
bool AreActionsRunning ()
 Checks if any Actions are currently being run. More...
 
void ResetList ()
 
virtual void Kill ()
 
bool IsSkippable ()
 Checks if the ActionListAsset is skippable. This is safer than just reading 'isSkippable', because it also accounts for actionListType - since ActionLists that run in the background cannot be skipped More...
 
List< ActionGetActions ()
 Gets the List of Actions that this ActionList runs, regardless of source. More...
 
ActionParameter GetParameter (string label)
 Gets a parameter of a given name. More...
 
ActionParameter GetParameter (int _ID)
 Gets a parameter of a given ID number. More...
 
void Pause ()
 Pauses the ActionList once it has finished running it's current Action. More...
 
void Resume (int _startIndex, int[] _resumeIndices, string _parameterData, bool rerunPreviousAction=false)
 Resumes the ActionList. More...
 
string GetParameterData ()
 Gets the current ActionParameter values as a serializable string. More...
 
void SetParameterData (string dataString)
 Assigns parameter values based on a string generated by the GetParameterData function More...
 
int GetNumItemReferences (int itemID)
 
int UpdateItemReferences (int oldItemID, int newItemID)
 
int GetNumMenuReferences (string menuName, string elementName="")
 
int GetNumVariableReferences (VariableLocation _location, int variableID, Variables _variables=null, int _variablesConstantID=0)
 
int UpdateVariableReferences (VariableLocation _location, int oldVariableID, int newVariableID, Variables _variables=null, int _variablesConstantID=0)
 
int GetNumDocumentReferences (int documentID)
 
int UpdateDocumentReferences (int oldDocumentID, int newDocumentID)
 
int GetNumObjectiveReferences (int objectiveID)
 
int UpdateObjectiveReferences (int oldObjectiveID, int newObjectiveID)
 
bool ReferencesAsset (ActionListAsset actionListAsset)
 
List< ActionListAssetGetReferencedActionListAssets ()
 
bool ActionModified (int index)
 

Public Attributes

TriggerDetects detects = TriggerDetects.Player
 
GameObject obToDetect
 
string detectComponent = ""
 
int triggerType
 
bool cancelInteractions = false
 
TriggerReacts triggerReacts = TriggerReacts.OnlyDuringGameplay
 
TriggerDetectionMethod detectionMethod = TriggerDetectionMethod.RigidbodyCollision
 
bool detectsPlayer = true
 
bool detectsAllPlayers = false
 
List< GameObject > obsToDetect = new List<GameObject>()
 
bool canInterruptSelf = true
 
int gameObjectParameterID = -1
 
- Public Attributes inherited from AC.ActionList
List< AC.Actionactions = new List<AC.Action> ()
 
bool isSkippable = true
 
float triggerTime = 0f
 
bool autosaveAfter = false
 
ActionListType actionListType = ActionListType.PauseGameplay
 
Conversation conversation = null
 
ActionListAsset assetFile
 
ActionListSource source
 
bool unfreezePauseMenus = true
 
bool useParameters = false
 
List< ActionParameterparameters = new List<ActionParameter> ()
 
int tagID
 
bool syncParamValues = true
 

Protected Member Functions

void OnEnable ()
 
void Start ()
 
void OnDisable ()
 
void OnTriggerEnter (Collider other)
 
void OnTriggerEnter2D (Collider2D other)
 
void OnTriggerStay (Collider other)
 
void OnTriggerStay2D (Collider2D other)
 
void OnTriggerExit (Collider other)
 
void OnTriggerExit2D (Collider2D other)
 
void Interact (GameObject collisionOb)
 
bool IsObjectCorrect (GameObject obToCheck)
 
bool CheckForPoint (Vector3 position)
 
void OnPlayerSpawn (Player player)
 
void OnPlayerRemove (Player player)
 
void InitTrigger ()
 
void OnDrawGizmos ()
 
void OnDrawGizmosSelected ()
 
void DrawGizmos ()
 
- Protected Member Functions inherited from AC.ActionList
virtual void BeginActionList (int i, bool addToSkipQueue)
 
void ProcessAction (int i)
 
void CheckEndCutscene ()
 
virtual void ReturnLastResultToSource (int index, int i)
 
virtual void FinishPause ()
 
virtual void PrintActionComment (Action action)
 
virtual void AddResumeToManager (int startIndex)
 

Protected Attributes

Collider2D _collider2D
 
Collider _collider
 
List< PositionDetectObjectpositionDetectObjects = new List<PositionDetectObject>()
 
- Protected Attributes inherited from AC.ActionList
bool isSkipping = false
 
LayerMask LayerHotspot
 
LayerMask LayerOff
 
List< int > resumeIndices = new List<int> ()
 
bool isChangingScene = false
 

Additional Inherited Members

- Static Public Member Functions inherited from AC.ActionList
static AC.Action GetDefaultAction ()
 Gets the default Action set within ActionsManager. More...
 
- Static Public Attributes inherited from AC.ActionList
static string logSuffix
 
- Properties inherited from AC.ActionList
int NumParameters [get]
 

Detailed Description

An ActionList that is run when the Player, or another object, comes into contact with it.

Member Function Documentation

◆ AddObjectToDetect()

void AC.AC_Trigger.AddObjectToDetect ( GameObject  _gameObject)

Registers an object as one that can be detected by the Trigger, provided that detectionMethod = TriggerDetectionMethod.TransformPosition

Parameters
_gameObjectThe object to detect

◆ Interact()

override void AC.AC_Trigger.Interact ( )
virtual

Runs the Actions normally, from the beginning.

Reimplemented from AC.ActionList.

◆ IsOn()

bool AC.AC_Trigger.IsOn ( )

Checks if the Trigger is enabled.

Returns
True if the Trigger is enabled.

◆ RemoveObjectToDetect()

void AC.AC_Trigger.RemoveObjectToDetect ( GameObject  _gameObject)

Registers an object as one that cancanot be detected by the Trigger, provided that detectionMethod = TriggerDetectionMethod.TransformPosition

Parameters
_gameObjectThe object to no longer detect

◆ TurnOff()

void AC.AC_Trigger.TurnOff ( )

Disables the Trigger.

◆ TurnOn()

void AC.AC_Trigger.TurnOn ( )

Enables the Trigger.

Member Data Documentation

◆ cancelInteractions

bool AC.AC_Trigger.cancelInteractions = false

If True, and the Player sets off the Trigger while walking towards a Hotspot Interaction, then the Player will stop, and the Interaction will be cancelled

◆ canInterruptSelf

bool AC.AC_Trigger.canInterruptSelf = true

If True, then the Trigger will restart if it is triggered while already running. Otherwise, it will not restart.

◆ detectComponent

string AC.AC_Trigger.detectComponent = ""

The component that must be attached to an object for the Trigger to react to, if detectionMethod = TriggerDetectionMethod.RigidbodyCollision and detects = TriggerDetects.AnyObjectWithComponent

◆ detectionMethod

TriggerDetectionMethod AC.AC_Trigger.detectionMethod = TriggerDetectionMethod.RigidbodyCollision

The way in which objects are detected (RigidbodyCollision, TransformPosition)

◆ detects

TriggerDetects AC.AC_Trigger.detects = TriggerDetects.Player

If detectionMethod = TriggerDetectionMethod.RigidbodyCollision, what the Trigger will react to (Player, SetObject, AnyObject, AnyObjectWithComponent)

◆ detectsAllPlayers

bool AC.AC_Trigger.detectsAllPlayers = false

If True, and detectsPlayer = True, and player-switching is enabled, then inactive Players will be detected too

◆ detectsPlayer

bool AC.AC_Trigger.detectsPlayer = true

If True, and detectionMethod = TriggerDetectionMethod.TransformPosition, then the Trigger will react to the active Player

◆ obsToDetect

List<GameObject> AC.AC_Trigger.obsToDetect = new List<GameObject>()

The GameObjects that the Trigger reacts to, if detectionMethod = TriggerDetectionMethod.TransformPosition

◆ obToDetect

GameObject AC.AC_Trigger.obToDetect

The GameObject that the Trigger reacts to, if detectionMethod = TriggerDetectionMethod.RigidbodyCollision and detects = TriggerDetects.SetObject

◆ triggerReacts

TriggerReacts AC.AC_Trigger.triggerReacts = TriggerReacts.OnlyDuringGameplay

The state of the game under which the trigger reacts (OnlyDuringGameplay, OnlyDuringCutscenes, DuringCutscenesAndGameplay)

◆ triggerType

int AC.AC_Trigger.triggerType

What kind of contact the Trigger reacts to (0 = "On enter", 1 = "Continuous", 2 = "On exit")