<?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=OnFamilyNameChanged</id>
	<title>OnFamilyNameChanged - 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=OnFamilyNameChanged"/>
	<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=OnFamilyNameChanged&amp;action=history"/>
	<updated>2026-05-12T23:27:46Z</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=OnFamilyNameChanged&amp;diff=949&amp;oldid=prev</id>
		<title>Tayfunwiki: Created page with &quot;== &lt;code&gt;onFamilyNameChanged&lt;/code&gt; Event in Family Class ==  === Overview === The &lt;code&gt;onFamilyNameChanged&lt;/code&gt; event in the Family class is triggered when there is a change in the name of a family. This event is particularly important in games where family identity and legacy play a significant role, as it allows for dynamic updates and responses to changes in family nomenclature.  === Event Definition === &lt;syntaxhighlight lang=&quot;c#&quot;&gt; public event Action&lt;string&gt; onFa...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=OnFamilyNameChanged&amp;diff=949&amp;oldid=prev"/>
		<updated>2024-01-05T02:39:04Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== &amp;lt;code&amp;gt;onFamilyNameChanged&amp;lt;/code&amp;gt; Event in Family Class ==  === Overview === The &amp;lt;code&amp;gt;onFamilyNameChanged&amp;lt;/code&amp;gt; event in the Family class is triggered when there is a change in the name of a family. This event is particularly important in games where family identity and legacy play a significant role, as it allows for dynamic updates and responses to changes in family nomenclature.  === Event Definition === &amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt; public event Action&amp;lt;string&amp;gt; onFa...&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;onFamilyNameChanged&amp;lt;/code&amp;gt; Event in Family Class ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
The &amp;lt;code&amp;gt;onFamilyNameChanged&amp;lt;/code&amp;gt; event in the Family class is triggered when there is a change in the name of a family. This event is particularly important in games where family identity and legacy play a significant role, as it allows for dynamic updates and responses to changes in family nomenclature.&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 event Action&amp;lt;string&amp;gt; onFamilyNameChanged;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
* Event Type: &amp;lt;code&amp;gt;Action&amp;lt;string&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Functionality: Notifies when the family's name is changed, passing the new name as a parameter.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
This event can be utilized to update UI elements, trigger narrative changes, or adjust game mechanics in response to a change in a family's name. It's useful in scenarios where the family name is tied to reputations, alliances, land holdings, or other in-game factors.&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 FamilyNameListener : MonoBehaviour {&lt;br /&gt;
    void Start() {&lt;br /&gt;
        Family playerFamily = IM.Player.Family;&lt;br /&gt;
        if (playerFamily != null) {&lt;br /&gt;
            playerFamily.onFamilyNameChanged += HandleFamilyNameChange;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    private void HandleFamilyNameChange(string oldName) {&lt;br /&gt;
        Debug.Log($&amp;quot;The player's family name has been changed to: {IM.Player.Family.FamilyName}, Old name: {oldName}&amp;quot;);&lt;br /&gt;
        // Additional logic to handle the name change&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    void OnDestroy() {&lt;br /&gt;
        if (IM.Player.Family != null) {&lt;br /&gt;
            IM.Player.Family.onFamilyNameChanged -= HandleFamilyNameChange;&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 how to subscribe to the &amp;lt;code&amp;gt;onFamilyNameChanged&amp;lt;/code&amp;gt; event and handle it.&lt;br /&gt;
* When the family's name changes, &amp;lt;code&amp;gt;HandleFamilyNameChange&amp;lt;/code&amp;gt; is called, logging the new name and potentially triggering other related actions.&lt;br /&gt;
&lt;br /&gt;
=== Remarks ===&lt;br /&gt;
&lt;br /&gt;
* It's important to unsubscribe from the event when the object is destroyed to prevent memory leaks or unwanted behavior.&lt;br /&gt;
* The &amp;lt;code&amp;gt;onFamilyNameChanged&amp;lt;/code&amp;gt; event helps maintain consistency and accuracy in the game's narrative and UI, reflecting changes in family identity in real-time.&lt;/div&gt;</summary>
		<author><name>Tayfunwiki</name></author>
	</entry>
</feed>