<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.wlabsocks.com/wiki/index.php?action=history&amp;feed=atom&amp;title=OnTrigger</id>
	<title>OnTrigger - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.wlabsocks.com/wiki/index.php?action=history&amp;feed=atom&amp;title=OnTrigger"/>
	<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=OnTrigger&amp;action=history"/>
	<updated>2026-05-06T00:54:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>http://www.wlabsocks.com/wiki/index.php?title=OnTrigger&amp;diff=1065&amp;oldid=prev</id>
		<title>Tayfunwiki at 10:45, 12 January 2024</title>
		<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=OnTrigger&amp;diff=1065&amp;oldid=prev"/>
		<updated>2024-01-12T10:45:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 06:45, 12 January 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[File:Trigger Node.gif|thumb|Trigger Node]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== &amp;lt;code&amp;gt;OnTrigger&amp;lt;/code&amp;gt; Event in Actor Class ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== &amp;lt;code&amp;gt;OnTrigger&amp;lt;/code&amp;gt; Event in Actor Class ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tayfunwiki</name></author>
	</entry>
	<entry>
		<id>http://www.wlabsocks.com/wiki/index.php?title=OnTrigger&amp;diff=793&amp;oldid=prev</id>
		<title>Tayfunwiki: Created page with &quot;== &lt;code&gt;OnTrigger&lt;/code&gt; Event in Actor Class ==  === Overview === The &lt;code&gt;OnTrigger&lt;/code&gt; event in the &lt;code&gt;Actor&lt;/code&gt; class is designed to respond to specific triggers activated for the actor, particularly those initiated by a &lt;code&gt;TriggerNode&lt;/code&gt;. This event plays a pivotal role in games where triggers influence character actions, gameplay mechanics, or narrative progression.  === Description ===  * Event Type: &lt;code&gt;Action&lt;string, bool&gt;&lt;/code&gt; * Functional...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=OnTrigger&amp;diff=793&amp;oldid=prev"/>
		<updated>2023-12-25T10:09:47Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== &amp;lt;code&amp;gt;OnTrigger&amp;lt;/code&amp;gt; Event in Actor Class ==  === Overview === The &amp;lt;code&amp;gt;OnTrigger&amp;lt;/code&amp;gt; event in the &amp;lt;code&amp;gt;Actor&amp;lt;/code&amp;gt; class is designed to respond to specific triggers activated for the actor, particularly those initiated by a &amp;lt;code&amp;gt;TriggerNode&amp;lt;/code&amp;gt;. This event plays a pivotal role in games where triggers influence character actions, gameplay mechanics, or narrative progression.  === Description ===  * Event Type: &amp;lt;code&amp;gt;Action&amp;lt;string, bool&amp;gt;&amp;lt;/code&amp;gt; * Functional...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== &amp;lt;code&amp;gt;OnTrigger&amp;lt;/code&amp;gt; Event in Actor Class ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
The &amp;lt;code&amp;gt;OnTrigger&amp;lt;/code&amp;gt; event in the &amp;lt;code&amp;gt;Actor&amp;lt;/code&amp;gt; class is designed to respond to specific triggers activated for the actor, particularly those initiated by a &amp;lt;code&amp;gt;TriggerNode&amp;lt;/code&amp;gt;. This event plays a pivotal role in games where triggers influence character actions, gameplay mechanics, or narrative progression.&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
* Event Type: &amp;lt;code&amp;gt;Action&amp;lt;string, bool&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Functionality: This event is fired when a specific trigger, often set up via a &amp;lt;code&amp;gt;TriggerNode&amp;lt;/code&amp;gt;, is activated for the actor. It receives a string identifier for the trigger and a boolean value representing the trigger's state. This design facilitates responsive actions to various triggered conditions.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
The event is ideal for executing actions or logic in the game in response to trigger activations. This could include changing the actor’s behavior, initiating gameplay sequences, or advancing the storyline based on the nature of the trigger.&lt;br /&gt;
&lt;br /&gt;
=== Subscribing to the Event ===&lt;br /&gt;
To effectively handle trigger events, subscribe a method with the signature &amp;lt;code&amp;gt;Action&amp;lt;string, bool&amp;gt;&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;OnTrigger&amp;lt;/code&amp;gt; event within a MonoBehaviour script. Unsubscribing from the event when it's no longer needed is crucial to maintain optimal game performance.&lt;br /&gt;
&lt;br /&gt;
=== Example of Usage ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
public class TriggerResponseHandler : MonoBehaviour {&lt;br /&gt;
    public Actor actor;&lt;br /&gt;
&lt;br /&gt;
    void Start() {&lt;br /&gt;
        if (actor != null) {&lt;br /&gt;
            actor.OnTrigger += OnSpecificTriggerActivated;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    private void OnSpecificTriggerActivated(string triggerName, bool triggerState) {&lt;br /&gt;
        Debug.Log($&amp;quot;Trigger '{triggerName}' activated for {actor.FullName} with state: {triggerState}&amp;quot;);&lt;br /&gt;
        // Custom logic to handle the activation of the trigger&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    void OnDestroy() {&lt;br /&gt;
        if (actor != null) {&lt;br /&gt;
            actor.OnTrigger -= OnSpecificTriggerActivated;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;In this script, &amp;lt;code&amp;gt;TriggerResponseHandler&amp;lt;/code&amp;gt; is attached to a GameObject and subscribes to the &amp;lt;code&amp;gt;OnTrigger&amp;lt;/code&amp;gt; event of an &amp;lt;code&amp;gt;Actor&amp;lt;/code&amp;gt;. When a trigger is activated, possibly by a &amp;lt;code&amp;gt;TriggerNode&amp;lt;/code&amp;gt;, the &amp;lt;code&amp;gt;OnSpecificTriggerActivated&amp;lt;/code&amp;gt; method is called, allowing for appropriate responses to the trigger event.&lt;br /&gt;
&lt;br /&gt;
=== Remarks ===&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;OnTrigger&amp;lt;/code&amp;gt; event is essential in creating dynamic and interactive gameplay experiences, allowing for conditional responses to specific game events.&lt;br /&gt;
* Proper management of this event enhances the game’s interactivity and responsiveness, especially in scenarios where triggers dictate significant changes or actions.&lt;br /&gt;
* This event is particularly significant in games with complex mechanics or narrative-driven structures, where triggers set by &amp;lt;code&amp;gt;TriggerNodes&amp;lt;/code&amp;gt; play a crucial role in driving gameplay and story elements.&lt;/div&gt;</summary>
		<author><name>Tayfunwiki</name></author>
	</entry>
</feed>