<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Infinity Code Forum — Acitivate/ disactivate Buildings]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=593</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=593&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Acitivate/ disactivate Buildings.]]></description>
		<lastBuildDate>Tue, 18 Jul 2017 15:48:42 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Acitivate/ disactivate Buildings]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2621#p2621</link>
			<description><![CDATA[<p>Hello.</p><p>The example for version 2.5.12 or older is above.<br />Please explain in detail what exactly does not work well, and how you expected it to work.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 18 Jul 2017 15:48:42 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2621#p2621</guid>
		</item>
		<item>
			<title><![CDATA[Re: Acitivate/ disactivate Buildings]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2618#p2618</link>
			<description><![CDATA[<p>Hi,</p><p>I try to implement this function to activate/deactivate the buildings, But it&#039;s not working very well and it take much time to be executed.<br />I saw that you have released a new version of the plugin with the ability of activating/deactivating the buildings, but I am stick with the version 2.5.12.1 and can not update to the next version.</p><p>Is there a possibility or exemple for this version to activate/deactivate buildings with a clean process?</p><p>Thanks in advance</p>]]></description>
			<author><![CDATA[null@example.com (trouk)]]></author>
			<pubDate>Tue, 18 Jul 2017 13:43:10 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2618#p2618</guid>
		</item>
		<item>
			<title><![CDATA[Re: Acitivate/ disactivate Buildings]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2583#p2583</link>
			<description><![CDATA[<p>Hello.</p><p>Unfortunately, the current version of Online Maps does not have a good way to deactivate buildings.<br />Currently you can use this way:<br /></p><div class="codebox"><pre><code>using System.Reflection;
using UnityEngine;

public class DeactivateBuildings:MonoBehaviour
{
    private bool activated = true;

    private void OnGUI()
    {
        if (GUILayout.Button(activated ? &quot;Deactivate&quot; : &quot;Activate&quot;))
        {
            activated = !activated;
            if (activated)
            {
                OnlineMapsBuildings.instance.enabled = true;

                FieldInfo fTopLeft = typeof(OnlineMapsBuildings).GetField(&quot;topLeft&quot;, BindingFlags.Instance | BindingFlags.NonPublic);
                FieldInfo fBottomRight = typeof(OnlineMapsBuildings).GetField(&quot;bottomRight&quot;, BindingFlags.Instance | BindingFlags.NonPublic);
                fTopLeft.SetValue(OnlineMapsBuildings.instance, new OnlineMapsVector2i());
                fBottomRight.SetValue(OnlineMapsBuildings.instance, new OnlineMapsVector2i());
            }
            else
            {
                MethodInfo method = typeof(OnlineMapsBuildings).GetMethod(&quot;RemoveAllBuildings&quot;, BindingFlags.Instance | BindingFlags.NonPublic);
                method.Invoke(OnlineMapsBuildings.instance, null);
                OnlineMapsBuildings.instance.enabled = false;
            }
        }
    }
}</code></pre></div><p>Yes, it&#039;s a dirty hack.<br />We will add the ability to correctly activate and deactivate buildings in the next version.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Sat, 08 Jul 2017 18:58:00 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2583#p2583</guid>
		</item>
		<item>
			<title><![CDATA[Acitivate/ disactivate Buildings]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2580#p2580</link>
			<description><![CDATA[<p>Hi,</p><p>How can I activate desactivate buildings in Runtime With a switch button ?</p>]]></description>
			<author><![CDATA[null@example.com (trouk)]]></author>
			<pubDate>Fri, 07 Jul 2017 13:23:02 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2580#p2580</guid>
		</item>
	</channel>
</rss>
