<?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=OnFamilyCultureChanged</id>
	<title>OnFamilyCultureChanged - 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=OnFamilyCultureChanged"/>
	<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=OnFamilyCultureChanged&amp;action=history"/>
	<updated>2026-04-16T15:01: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=OnFamilyCultureChanged&amp;diff=951&amp;oldid=prev</id>
		<title>Tayfunwiki: Created page with &quot;== &lt;code&gt;onFamilyCultureChanged&lt;/code&gt; Event in Family Class ==  === Overview === The &lt;code&gt;onFamilyCultureChanged&lt;/code&gt; event in the Family class triggers when there is a change in the family's associated culture. This event is significant in games where cultural aspects play a key role in shaping family identity, traditions, and interactions within the game world.  === Event Definition === &lt;syntaxhighlight lang=&quot;c#&quot;&gt; public event Action&lt;Culture&gt; onFamilyCultureChanged...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=OnFamilyCultureChanged&amp;diff=951&amp;oldid=prev"/>
		<updated>2024-01-05T02:42:28Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== &amp;lt;code&amp;gt;onFamilyCultureChanged&amp;lt;/code&amp;gt; Event in Family Class ==  === Overview === The &amp;lt;code&amp;gt;onFamilyCultureChanged&amp;lt;/code&amp;gt; event in the Family class triggers when there is a change in the family&amp;#039;s associated culture. This event is significant in games where cultural aspects play a key role in shaping family identity, traditions, and interactions within the game world.  === Event Definition === &amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt; public event Action&amp;lt;Culture&amp;gt; onFamilyCultureChanged...&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;onFamilyCultureChanged&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;onFamilyCultureChanged&amp;lt;/code&amp;gt; event in the Family class triggers when there is a change in the family's associated culture. This event is significant in games where cultural aspects play a key role in shaping family identity, traditions, and interactions within the game world.&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;Culture&amp;gt; onFamilyCultureChanged;&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;Culture&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Functionality: Notifies subscribers when the family's culture is altered, providing the new &amp;lt;code&amp;gt;Culture&amp;lt;/code&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
This event can be utilized to adapt game elements, such as dialogue, missions, or character interactions, in response to the cultural shift within a family. It's particularly relevant in narrative-driven games where cultural background influences character development and story arcs.&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 FamilyCultureListener : MonoBehaviour {&lt;br /&gt;
    void Start() {&lt;br /&gt;
        Family playerFamily = IM.Player.Family;&lt;br /&gt;
        if (playerFamily != null) {&lt;br /&gt;
            playerFamily.onFamilyCultureChanged += HandleFamilyCultureChange;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    private void HandleFamilyCultureChange(Culture oldCulture) {&lt;br /&gt;
        Debug.Log($&amp;quot;The player's family culture has been changed to: {IM.Player.Family.Culture.CultureName}, Old name: {oldCulture.CultureName}&amp;quot;);&lt;br /&gt;
        // Additional logic to handle the culture 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.onFamilyCultureChanged -= HandleFamilyCultureChange;&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;
* In the example, the &amp;lt;code&amp;gt;onFamilyCultureChanged&amp;lt;/code&amp;gt; event is used to handle changes in the player's family culture.&lt;br /&gt;
* When the family's culture changes, &amp;lt;code&amp;gt;HandleFamilyCultureChange&amp;lt;/code&amp;gt; is called, logging the new culture name and potentially triggering related game mechanics.&lt;br /&gt;
&lt;br /&gt;
=== Remarks ===&lt;br /&gt;
&lt;br /&gt;
* It is crucial to unsubscribe from the event when the object is destroyed to avoid memory leaks or unexpected behavior.&lt;br /&gt;
* The &amp;lt;code&amp;gt;onFamilyCultureChanged&amp;lt;/code&amp;gt; event helps ensure that the game accurately reflects changes in cultural dynamics, enhancing realism and player engagement.&lt;/div&gt;</summary>
		<author><name>Tayfunwiki</name></author>
	</entry>
</feed>