<?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=OnPlayerIsChanged</id>
	<title>OnPlayerIsChanged - 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=OnPlayerIsChanged"/>
	<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=OnPlayerIsChanged&amp;action=history"/>
	<updated>2026-05-06T00:54:01Z</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=OnPlayerIsChanged&amp;diff=851&amp;oldid=prev</id>
		<title>Tayfunwiki: Created page with &quot;== &lt;code&gt;onPlayerIsChanged&lt;/code&gt; Event in IM Class ==  === Overview === The &lt;code&gt;onPlayerIsChanged&lt;/code&gt; event in the IM (Intrigue Manager) class is a significant event handler that is triggered when there is a change in the player's character within the game.  === Description ===  * Event Type: &lt;code&gt;Action&lt;Actor, Actor&gt;&lt;/code&gt; * Functionality: ** This event is activated when the current player character is changed. ** It passes two &lt;code&gt;Actor&lt;/code&gt; objects as para...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=OnPlayerIsChanged&amp;diff=851&amp;oldid=prev"/>
		<updated>2024-01-04T18:27:58Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== &amp;lt;code&amp;gt;onPlayerIsChanged&amp;lt;/code&amp;gt; Event in IM Class ==  === Overview === The &amp;lt;code&amp;gt;onPlayerIsChanged&amp;lt;/code&amp;gt; event in the IM (Intrigue Manager) class is a significant event handler that is triggered when there is a change in the player&amp;#039;s character within the game.  === Description ===  * Event Type: &amp;lt;code&amp;gt;Action&amp;lt;Actor, Actor&amp;gt;&amp;lt;/code&amp;gt; * Functionality: ** This event is activated when the current player character is changed. ** It passes two &amp;lt;code&amp;gt;Actor&amp;lt;/code&amp;gt; objects as para...&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;onPlayerIsChanged&amp;lt;/code&amp;gt; Event in IM Class ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
The &amp;lt;code&amp;gt;onPlayerIsChanged&amp;lt;/code&amp;gt; event in the IM (Intrigue Manager) class is a significant event handler that is triggered when there is a change in the player's character within the game.&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
* Event Type: &amp;lt;code&amp;gt;Action&amp;lt;Actor, Actor&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Functionality:&lt;br /&gt;
** This event is activated when the current player character is changed.&lt;br /&gt;
** It passes two &amp;lt;code&amp;gt;Actor&amp;lt;/code&amp;gt; objects as parameters: the previous player character and the new player character.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
The &amp;lt;code&amp;gt;onPlayerIsChanged&amp;lt;/code&amp;gt; event is essential for handling transitions between player characters. It enables the game to adapt its state and behavior based on the change in the player's character, which can be crucial for gameplay mechanics, narrative progression, and maintaining player context.&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 PlayerCharacterManager : MonoBehaviour {&lt;br /&gt;
    void OnEnable() {&lt;br /&gt;
        IM.onPlayerIsChanged += HandlePlayerChange;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    void OnDisable() {&lt;br /&gt;
        IM.onPlayerIsChanged -= HandlePlayerChange;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    private void HandlePlayerChange(Actor oldPlayer, Actor newPlayer) {&lt;br /&gt;
        Debug.Log($&amp;quot;Player character changed from {oldPlayer.Name} to {newPlayer.Name}&amp;quot;);&lt;br /&gt;
        // Additional logic to handle the change in player character&lt;br /&gt;
        // This might include updating UI elements, resetting game states, or adapting game mechanics&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Description: ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;HandlePlayerChange&amp;lt;/code&amp;gt;: Subscribed to the &amp;lt;code&amp;gt;onPlayerIsChanged&amp;lt;/code&amp;gt; event, this method is called when the player's character changes. It processes the information about both the old and new player characters, allowing for appropriate responses to the change.&lt;br /&gt;
&lt;br /&gt;
=== Remarks ===&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;onPlayerIsChanged&amp;lt;/code&amp;gt; event is critical in games where players can switch between different characters, affecting gameplay and narrative.&lt;br /&gt;
* Properly handling this event ensures a seamless transition for the player, preserving game continuity and player immersion.&lt;br /&gt;
* It's particularly relevant in role-playing games, adventure games, or any genre that involves multiple playable characters or avatars.&lt;/div&gt;</summary>
		<author><name>Tayfunwiki</name></author>
	</entry>
</feed>