<?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=Family.OnMemberLeave</id>
	<title>Family.OnMemberLeave - 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=Family.OnMemberLeave"/>
	<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=Family.OnMemberLeave&amp;action=history"/>
	<updated>2026-05-12T23:27:47Z</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=Family.OnMemberLeave&amp;diff=953&amp;oldid=prev</id>
		<title>Tayfunwiki: Created page with &quot;== &lt;code&gt;onMemberLeave&lt;/code&gt; Event in Family Class ==  === Overview === The &lt;code&gt;onMemberLeave&lt;/code&gt; event in the Family class is invoked when a member leaves the family. This event is particularly important in games where the dynamics of family membership, alliances, and relationships significantly influence the gameplay and story.  === Event Definition === &lt;syntaxhighlight lang=&quot;c#&quot;&gt; public event Action&lt;Actor&gt; onMemberLeave; &lt;/syntaxhighlight&gt;  === Description ===...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=Family.OnMemberLeave&amp;diff=953&amp;oldid=prev"/>
		<updated>2024-01-05T02:43:38Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== &amp;lt;code&amp;gt;onMemberLeave&amp;lt;/code&amp;gt; Event in Family Class ==  === Overview === The &amp;lt;code&amp;gt;onMemberLeave&amp;lt;/code&amp;gt; event in the Family class is invoked when a member leaves the family. This event is particularly important in games where the dynamics of family membership, alliances, and relationships significantly influence the gameplay and story.  === Event Definition === &amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt; public event Action&amp;lt;Actor&amp;gt; onMemberLeave; &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;onMemberLeave&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;onMemberLeave&amp;lt;/code&amp;gt; event in the Family class is invoked when a member leaves the family. This event is particularly important in games where the dynamics of family membership, alliances, and relationships significantly influence the gameplay and story.&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;Actor&amp;gt; onMemberLeave;&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;Actor&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Functionality: Activates when a member departs from the family, providing the departing &amp;lt;code&amp;gt;Actor&amp;lt;/code&amp;gt; as an argument.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
This event can be used to update family records, alter the narrative, or modify gameplay in response to a change in the family's composition. It's vital in narrative-driven games or those where family ties impact the plot or character interactions.&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 FamilyMemberDepartureListener : MonoBehaviour {&lt;br /&gt;
    void Start() {&lt;br /&gt;
        Family playerFamily = IM.Player.Family;&lt;br /&gt;
        if (playerFamily != null) {&lt;br /&gt;
            playerFamily.onMemberLeave += HandleFamilyMemberDeparture;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    private void HandleFamilyMemberDeparture(Actor departingMember) {&lt;br /&gt;
        Debug.Log($&amp;quot;Member {departingMember.Name} has left the player's family.&amp;quot;);&lt;br /&gt;
        // Additional logic for handling the departure of a family member&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.onMemberLeave -= HandleFamilyMemberDeparture;&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;
* The example shows how to subscribe to and handle the &amp;lt;code&amp;gt;onMemberLeave&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* When a member leaves the player's family, &amp;lt;code&amp;gt;HandleFamilyMemberDeparture&amp;lt;/code&amp;gt; is called, logging the departure and enabling additional responses or updates.&lt;br /&gt;
&lt;br /&gt;
=== Remarks ===&lt;br /&gt;
&lt;br /&gt;
* It's crucial to unsubscribe from the event in the &amp;lt;code&amp;gt;OnDestroy&amp;lt;/code&amp;gt; method to avoid memory leaks or unintended behaviors.&lt;br /&gt;
* The &amp;lt;code&amp;gt;onMemberLeave&amp;lt;/code&amp;gt; event ensures that the game accurately reflects changes in family structure, enhancing realism and player engagement.&lt;/div&gt;</summary>
		<author><name>Tayfunwiki</name></author>
	</entry>
</feed>