Skip to content

TriggerCallback

Tommo J. Phillips edited this page Oct 22, 2023 · 3 revisions

TriggerCallback

Namespace: TommoJProductions.ModApi.Attachable

Represents call back for triggers.

public class TriggerCallback : UnityEngine.MonoBehaviour

Inheritance Object → Object → Component → Behaviour → MonoBehaviour → TriggerCallback

Fields

triggerData

Represents The Trigger Data. any part can install onto a trigger with the same trigger data.

public TriggerData triggerData;

Properties

part

Represents the part that is currently installed to this trigger. note null if no installed part.

public Part part { get; }

Property Value

Part

trigger

Represents the trigger that is instance is linked to.

public Trigger trigger { get; internal set; }

Property Value

Trigger

useGUILayout

public bool useGUILayout { get; set; }

Property Value

Boolean

enabled

public bool enabled { get; set; }

Property Value

Boolean

isActiveAndEnabled

public bool isActiveAndEnabled { get; }

Property Value

Boolean

transform

public Transform transform { get; }

Property Value

Transform

gameObject

public GameObject gameObject { get; }

Property Value

GameObject

tag

public string tag { get; set; }

Property Value

String

name

public string name { get; set; }

Property Value

String

hideFlags

public HideFlags hideFlags { get; set; }

Property Value

HideFlags

Constructors

TriggerCallback()

public TriggerCallback()

Methods

setPart(Part)

internal void setPart(Part part)

Parameters

part Part

triggerCheck(Collider, Part&)

checks all parts that have this trigger to see if is a Part and that it can be installed to this trigger.

protected virtual bool triggerCheck(Collider col, Part& part)

Parameters

col Collider
The collider that was in the trigger.

part Part&
the Part that was in the trigger, null if wasn't a Part or if the part can't be installed to this trigger.

Returns

Boolean

OnTriggerExit(Collider)

Occurs when a collider exits this trigger.

protected virtual void OnTriggerExit(Collider collider)

Parameters

collider Collider
the collider that invoked this

OnTriggerEnter(Collider)

Occurs when a collider enters this trigger.

protected virtual void OnTriggerEnter(Collider collider)

Parameters

collider Collider
the collider that invoked this

Events

onTriggerExit

Represents the on trigger exit event.

public event Action<Part, Trigger> onTriggerExit;

onTriggerEnter

Represents the on trigger enter event.

public event Action<Part, Trigger> onTriggerEnter;

Clone this wiki locally