<?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=Role.onRoleNameChanged</id>
	<title>Role.onRoleNameChanged - 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=Role.onRoleNameChanged"/>
	<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=Role.onRoleNameChanged&amp;action=history"/>
	<updated>2026-05-12T22:57:52Z</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=Role.onRoleNameChanged&amp;diff=994&amp;oldid=prev</id>
		<title>Tayfunwiki: Created page with &quot;=== Role Class - &lt;code&gt;onRoleNameChanged&lt;/code&gt; Event ===  ==== Overview ==== The &lt;code&gt;onRoleNameChanged&lt;/code&gt; event in the Role class is triggered whenever there is a change in the name of a role.  ==== Syntax ==== &lt;syntaxhighlight lang=&quot;c#&quot;&gt; public event Action&lt;string&gt; onRoleNameChanged; &lt;/syntaxhighlight&gt;  ==== Description ==== This event is useful for updating UI elements, game mechanics, or other components that rely on the role's name. The event passes the previo...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=Role.onRoleNameChanged&amp;diff=994&amp;oldid=prev"/>
		<updated>2024-01-05T15:45:54Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=== Role Class - &amp;lt;code&amp;gt;onRoleNameChanged&amp;lt;/code&amp;gt; Event ===  ==== Overview ==== The &amp;lt;code&amp;gt;onRoleNameChanged&amp;lt;/code&amp;gt; event in the Role class is triggered whenever there is a change in the name of a role.  ==== Syntax ==== &amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt; public event Action&amp;lt;string&amp;gt; onRoleNameChanged; &amp;lt;/syntaxhighlight&amp;gt;  ==== Description ==== This event is useful for updating UI elements, game mechanics, or other components that rely on the role&amp;#039;s name. The event passes the previo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== Role Class - &amp;lt;code&amp;gt;onRoleNameChanged&amp;lt;/code&amp;gt; Event ===&lt;br /&gt;
&lt;br /&gt;
==== Overview ====&lt;br /&gt;
The &amp;lt;code&amp;gt;onRoleNameChanged&amp;lt;/code&amp;gt; event in the Role class is triggered whenever there is a change in the name of a role.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
public event Action&amp;lt;string&amp;gt; onRoleNameChanged;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Description ====&lt;br /&gt;
This event is useful for updating UI elements, game mechanics, or other components that rely on the role's name. The event passes the previous name of the role as a string parameter.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Subscribe to this event to perform actions whenever a role's name is updated, such as refreshing a list of roles in a management interface or logging changes for audit purposes.&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 RoleNameChangeListener : MonoBehaviour {&lt;br /&gt;
    void Start() {&lt;br /&gt;
        // Retrieve a specific role, e.g., &amp;quot;Leader&amp;quot;&lt;br /&gt;
        var role = IM.GetRole(&amp;quot;Leader&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // Subscribe to the onRoleNameChanged event&lt;br /&gt;
        role.onRoleNameChanged += OnRoleNameChanged;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    private void OnRoleNameChanged(string oldRoleName) {&lt;br /&gt;
        Debug.Log($&amp;quot;Role name changed from {oldRoleName} to {role.RoleName}&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Remarks ====&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;onRoleNameChanged&amp;lt;/code&amp;gt; event provides a mechanism to ensure that all aspects of the game that depend on role names remain up-to-date and consistent.&lt;br /&gt;
* This event is particularly important in dynamic game environments where roles may evolve or be redefined during gameplay.&lt;/div&gt;</summary>
		<author><name>Tayfunwiki</name></author>
	</entry>
</feed>