<?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=SetPlayer</id>
	<title>SetPlayer - 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=SetPlayer"/>
	<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=SetPlayer&amp;action=history"/>
	<updated>2026-05-12T23:26:38Z</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=SetPlayer&amp;diff=865&amp;oldid=prev</id>
		<title>Tayfunwiki: Created page with &quot;== &lt;code&gt;SetPlayer&lt;/code&gt; Method in IM Class ==  === Overview === The &lt;code&gt;SetPlayer&lt;/code&gt; method in the IM (Intrigue Manager) class allows for changing the current player character in the game by setting a new &lt;code&gt;Actor&lt;/code&gt; as the player.  === Description ===  * Method Signature: &lt;code&gt;public static void SetPlayer(Actor actor)&lt;/code&gt; * Parameters: ** &lt;code&gt;actor&lt;/code&gt;: The &lt;code&gt;Actor&lt;/code&gt; object that is to be set as the new current player.  === Functionality...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=SetPlayer&amp;diff=865&amp;oldid=prev"/>
		<updated>2024-01-04T19:50:46Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== &amp;lt;code&amp;gt;SetPlayer&amp;lt;/code&amp;gt; Method in IM Class ==  === Overview === The &amp;lt;code&amp;gt;SetPlayer&amp;lt;/code&amp;gt; method in the IM (Intrigue Manager) class allows for changing the current player character in the game by setting a new &amp;lt;code&amp;gt;Actor&amp;lt;/code&amp;gt; as the player.  === Description ===  * Method Signature: &amp;lt;code&amp;gt;public static void SetPlayer(Actor actor)&amp;lt;/code&amp;gt; * Parameters: ** &amp;lt;code&amp;gt;actor&amp;lt;/code&amp;gt;: The &amp;lt;code&amp;gt;Actor&amp;lt;/code&amp;gt; object that is to be set as the new current player.  === Functionality...&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;SetPlayer&amp;lt;/code&amp;gt; Method in IM Class ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
The &amp;lt;code&amp;gt;SetPlayer&amp;lt;/code&amp;gt; method in the IM (Intrigue Manager) class allows for changing the current player character in the game by setting a new &amp;lt;code&amp;gt;Actor&amp;lt;/code&amp;gt; as the player.&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
* Method Signature: &amp;lt;code&amp;gt;public static void SetPlayer(Actor actor)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Parameters:&lt;br /&gt;
** &amp;lt;code&amp;gt;actor&amp;lt;/code&amp;gt;: The &amp;lt;code&amp;gt;Actor&amp;lt;/code&amp;gt; object that is to be set as the new current player.&lt;br /&gt;
&lt;br /&gt;
=== Functionality ===&lt;br /&gt;
&lt;br /&gt;
* The method first retrieves the current player and stores it as &amp;lt;code&amp;gt;oldPlayer&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It then sets the &amp;lt;code&amp;gt;actor&amp;lt;/code&amp;gt; parameter as the new current player.&lt;br /&gt;
* If the new player (&amp;lt;code&amp;gt;actor&amp;lt;/code&amp;gt;) is different from the old player (&amp;lt;code&amp;gt;oldPlayer&amp;lt;/code&amp;gt;), the method triggers the &amp;lt;code&amp;gt;onPlayerIsChanged&amp;lt;/code&amp;gt; event, passing both the old and new players as parameters.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
This method is used to update the player character within the game, allowing for dynamic changes to the player's avatar or role. This can be crucial in games with multiple playable characters or in scenarios where the player's character needs to change due to narrative or gameplay reasons.&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 PlayerSwitcher : MonoBehaviour {&lt;br /&gt;
    public Actor newPlayer;&lt;br /&gt;
&lt;br /&gt;
    public void SwitchPlayer() {&lt;br /&gt;
        if (newPlayer != null) {&lt;br /&gt;
            IM.SetPlayer(newPlayer);&lt;br /&gt;
            Debug.Log($&amp;quot;Player has been switched to: {newPlayer.Name}&amp;quot;);&lt;br /&gt;
        }&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;SwitchPlayer&amp;lt;/code&amp;gt;: This method showcases how to switch the current player to a different character using &amp;lt;code&amp;gt;IM.SetPlayer&amp;lt;/code&amp;gt;. It logs the change for confirmation.&lt;br /&gt;
&lt;br /&gt;
=== Remarks ===&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;SetPlayer&amp;lt;/code&amp;gt; method is particularly relevant in role-playing games or adventure games where the player might control different characters at different points in the game.&lt;br /&gt;
* It is essential for maintaining continuity and consistency in the gameplay experience, especially when the player character is central to the game's narrative and mechanics.&lt;br /&gt;
* Proper implementation ensures that the transition between player characters is seamless and does not disrupt the flow or state of the game.&lt;/div&gt;</summary>
		<author><name>Tayfunwiki</name></author>
	</entry>
</feed>