<?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=GetFamilyVariable</id>
	<title>GetFamilyVariable - 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=GetFamilyVariable"/>
	<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=GetFamilyVariable&amp;action=history"/>
	<updated>2026-05-12T21:42:50Z</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=GetFamilyVariable&amp;diff=1225&amp;oldid=prev</id>
		<title>Tayfunwiki: Created page with &quot;= &lt;code&gt;GetVariable&lt;/code&gt; Method Documentation =  == Description == The &lt;code&gt;GetVariable&lt;/code&gt; methods allow for retrieving a private variable from the family based on its name or ID. These methods come in two variants: a non-generic version that retrieves the variable and a generic version that retrieves the variable and casts it to a specified type.  == Method Signatures ==  === GetVariable (Non-Generic) === &lt;syntaxhighlight lang=&quot;c#&quot;&gt; public NVar GetVariable(string...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=GetFamilyVariable&amp;diff=1225&amp;oldid=prev"/>
		<updated>2024-08-05T12:52:24Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= &amp;lt;code&amp;gt;GetVariable&amp;lt;/code&amp;gt; Method Documentation =  == Description == The &amp;lt;code&amp;gt;GetVariable&amp;lt;/code&amp;gt; methods allow for retrieving a private variable from the family based on its name or ID. These methods come in two variants: a non-generic version that retrieves the variable and a generic version that retrieves the variable and casts it to a specified type.  == Method Signatures ==  === GetVariable (Non-Generic) === &amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt; public NVar GetVariable(string...&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;GetVariable&amp;lt;/code&amp;gt; Method Documentation =&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
The &amp;lt;code&amp;gt;GetVariable&amp;lt;/code&amp;gt; methods allow for retrieving a private variable from the family based on its name or ID. These methods come in two variants: a non-generic version that retrieves the variable and a generic version that retrieves the variable and casts it to a specified type.&lt;br /&gt;
&lt;br /&gt;
== Method Signatures ==&lt;br /&gt;
&lt;br /&gt;
=== GetVariable (Non-Generic) ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
public NVar GetVariable(string variableNameOrId)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;This method retrieves the variable with the specified name or ID from the family.&lt;br /&gt;
&lt;br /&gt;
=== GetVariable (Generic) ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
public T GetVariable&amp;lt;T&amp;gt;(string variableNameOrId) where T : NVar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;This method retrieves the variable with the specified name or ID from the family and casts it to the specified type &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Example Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Non-Generic Usage ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
NVar variable = IM.Player.Family.GetVariable(&amp;quot;someVariable&amp;quot;);&lt;br /&gt;
Debug.Log(variable.value);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Retrieves the &amp;lt;code&amp;gt;someVariable&amp;lt;/code&amp;gt; from the family and logs its value.&lt;br /&gt;
&lt;br /&gt;
=== Generic Usage ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
NBool booleanVar = IM.Player.Family.GetVariable&amp;lt;NBool&amp;gt;(&amp;quot;booleanVariable&amp;quot;);&lt;br /&gt;
Debug.Log(booleanVar.Value);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Retrieves the &amp;lt;code&amp;gt;booleanVariable&amp;lt;/code&amp;gt; from the family, casts it to an &amp;lt;code&amp;gt;NBool&amp;lt;/code&amp;gt; type, and logs its boolean value.&lt;br /&gt;
&lt;br /&gt;
'''Note''': &amp;lt;code&amp;gt;booleanVar.Value&amp;lt;/code&amp;gt; will return the value as a boolean type (&amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Tayfunwiki</name></author>
	</entry>
</feed>