<?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=OnActorRoleChanged</id>
	<title>OnActorRoleChanged - 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=OnActorRoleChanged"/>
	<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=OnActorRoleChanged&amp;action=history"/>
	<updated>2026-05-13T00:01:37Z</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=OnActorRoleChanged&amp;diff=929&amp;oldid=prev</id>
		<title>Tayfunwiki: Created page with &quot;== &lt;code&gt;onActorRoleChanged&lt;/code&gt; Event in Clan Class ==  === Overview === The &lt;code&gt;onActorRoleChanged&lt;/code&gt; event in the Clan class is triggered when there is a change in an actor's role within the clan. This event plays a critical role in tracking and responding to changes in the responsibilities and status of clan members.  === Event Definition === &lt;syntaxhighlight lang=&quot;c#&quot;&gt; public Action&lt;Actor, Role&gt; onActorRoleChanged; &lt;/syntaxhighlight&gt;  === Description ===  *...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=OnActorRoleChanged&amp;diff=929&amp;oldid=prev"/>
		<updated>2024-01-05T00:42:29Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== &amp;lt;code&amp;gt;onActorRoleChanged&amp;lt;/code&amp;gt; Event in Clan Class ==  === Overview === The &amp;lt;code&amp;gt;onActorRoleChanged&amp;lt;/code&amp;gt; event in the Clan class is triggered when there is a change in an actor&amp;#039;s role within the clan. This event plays a critical role in tracking and responding to changes in the responsibilities and status of clan members.  === Event Definition === &amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt; public Action&amp;lt;Actor, Role&amp;gt; onActorRoleChanged; &amp;lt;/syntaxhighlight&amp;gt;  === Description ===  *...&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;onActorRoleChanged&amp;lt;/code&amp;gt; Event in Clan Class ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
The &amp;lt;code&amp;gt;onActorRoleChanged&amp;lt;/code&amp;gt; event in the Clan class is triggered when there is a change in an actor's role within the clan. This event plays a critical role in tracking and responding to changes in the responsibilities and status of clan members.&lt;br /&gt;
&lt;br /&gt;
=== Event Definition ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
public Action&amp;lt;Actor, Role&amp;gt; onActorRoleChanged;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
* Delegate Type: &amp;lt;code&amp;gt;Action&amp;lt;Actor, Role&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Purpose: Notifies when an actor's role in the clan is changed.&lt;br /&gt;
* Parameters:&lt;br /&gt;
** &amp;lt;code&amp;gt;Actor&amp;lt;/code&amp;gt;: The actor whose role has changed.&lt;br /&gt;
** &amp;lt;code&amp;gt;Role&amp;lt;/code&amp;gt;: The previous role held by the actor.&lt;br /&gt;
&lt;br /&gt;
=== Functionality ===&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;onActorRoleChanged&amp;lt;/code&amp;gt; event is raised when there is a change in the role of an actor within the clan.&lt;br /&gt;
* It provides the &amp;lt;code&amp;gt;Actor&amp;lt;/code&amp;gt; object and the &amp;lt;code&amp;gt;Role&amp;lt;/code&amp;gt; object, representing the actor and their old role, respectively.&lt;br /&gt;
* This event allows for dynamic updates to game elements such as clan hierarchies, actor profiles, or triggering specific gameplay mechanics or narrative elements associated with role changes.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
This event is essential for scenarios where role assignments within a clan are crucial to gameplay dynamics, resource management, or storyline progression. It ensures that any change in an actor's role is consistently reflected and acted upon throughout the game.&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 ClanRoleChangeHandler : MonoBehaviour {&lt;br /&gt;
    void Start() {&lt;br /&gt;
        Clan playerClan = IM.Player.Clan;&lt;br /&gt;
        if (playerClan != null) {&lt;br /&gt;
            playerClan.onActorRoleChanged += HandleRoleChange;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    private void HandleRoleChange(Actor actor, Role oldRole) {&lt;br /&gt;
        string newRoleName = actor.Role.RoleName;&lt;br /&gt;
        Debug.Log($&amp;quot;Role change in player's clan: {actor.Name} changed from {oldRole.RoleName} to {newRoleName}&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    void OnDestroy() {&lt;br /&gt;
        if (IM.Player.Clan != null) {&lt;br /&gt;
            playerClan.onActorRoleChanged -= HandleRoleChange;&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;
* This example demonstrates subscribing to the &amp;lt;code&amp;gt;onActorRoleChanged&amp;lt;/code&amp;gt; event for the player's clan.&lt;br /&gt;
* When an actor's role changes, the &amp;lt;code&amp;gt;HandleRoleChange&amp;lt;/code&amp;gt; method is called, logging the actor's name and their transition from the old role to the new role.&lt;br /&gt;
* It also ensures to unsubscribe from the event upon the destruction of the GameObject to prevent memory leaks or unintended behavior.&lt;br /&gt;
&lt;br /&gt;
=== Remarks ===&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;onActorRoleChanged&amp;lt;/code&amp;gt; event is vital for maintaining a realistic portrayal of clan dynamics and hierarchy.&lt;br /&gt;
* It allows for a responsive and immersive gameplay experience, where role changes within a clan can have significant implications.&lt;/div&gt;</summary>
		<author><name>Tayfunwiki</name></author>
	</entry>
</feed>