<?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 — Activate / disable buildings]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=1280</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1280&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Activate / disable buildings.]]></description>
		<lastBuildDate>Thu, 27 Jun 2019 23:30:16 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Activate / disable buildings]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5246#p5246</link>
			<description><![CDATA[<p>I repeated both of your tests several times, and could not reproduce the buildings that appeared.<br />Perhaps the problem requires some additional condition.</p><p>The problem with duplicate Buildings GameObject is fixed.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 27 Jun 2019 23:30:16 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5246#p5246</guid>
		</item>
		<item>
			<title><![CDATA[Re: Activate / disable buildings]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5245#p5245</link>
			<description><![CDATA[<p>I tryed a few things.</p><p>Test A :<br />- the Online Maps Buildings component is enabled before launching app<br />- i launch the app<br />- i disable the Online Maps Buildings component via code directly in a Start() method<br />- later i will enabled the component via code<br />-the buildings appears correctly<br />- i disable the component again<br />- the buildings does disappear<br />- after half a second the buildings are back in the scene. <img src="https://forum.infinity-code.com/img/smilies/sad.png" width="15" height="15" alt="sad" /></p><p>Test B:<br />- the Online Maps Buildings component is disabled before launching app<br />- i launch the app<br />- later i will enabled the component via code<br />-the buildings appears correctly<br />- i disable the component again<br />- the buildings does disappear, and they don&#039;t come back until i enable the component again <img src="https://forum.infinity-code.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>The reason i was going for test A is that i was trying to enable / disable the component by doing :<br /></p><div class="codebox"><pre><code>public void use_Buildings(bool b)
{
     OnlineMapsBuildings.instance.enabled = b;
}</code></pre></div><p>And this throw an error since the onlineMapsBuildings instance does&#039;nt exist yet if i launch the app without it being enabled.</p><p>using this : <br /></p><div class="codebox"><pre><code>public void use_Buildings(bool b)
{
     OnlineMaps.instance.GetComponent&lt;OnlineMapsBuildings&gt;().enabled = b;
}</code></pre></div><p>Allow me to do &quot;test B&quot; and so my problem is solved.</p><p>Note that in both case, a new gameobject named &quot;buildings&quot; (which become the parent of all the buildins) is created each time i enable the component. </p><p><span class="postimg"><img src="https://i.imgur.com/KzXYUVw.jpg" alt="https://i.imgur.com/KzXYUVw.jpg" /></span></p><p>Hope this feedback is usefull <img src="https://forum.infinity-code.com/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[null@example.com (Thibault)]]></author>
			<pubDate>Thu, 27 Jun 2019 18:57:58 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5245#p5245</guid>
		</item>
		<item>
			<title><![CDATA[Re: Activate / disable buildings]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5243#p5243</link>
			<description><![CDATA[<p>Hello.</p><p>To disable buildings, you just need to disable Online Maps Buildings component.<br />I just checked it and it works correctly.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 27 Jun 2019 18:04:43 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5243#p5243</guid>
		</item>
		<item>
			<title><![CDATA[Activate / disable buildings]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5242#p5242</link>
			<description><![CDATA[<p>Hi<br />I started to use the OnlineMapsBuildings component.</p><p>What i want to achieve is basically being able to activate / disable the buildings at runtime.</p><p>I tried to disable the OnlineMapsBuildings script of the map but it does&#039;nt get rid of the buildings.</p><p>i tryed to delete manually the buildings with <br /></p><div class="codebox"><pre><code>foreach (OnlineMapsBuildingBase item in OnlineMapsBuildings.instance.buildings.Values)
{
      Destroy(item.gameObject);
}</code></pre></div><p>But they keep coming back ! </p><p>Is there a way to achieve this ?</p>]]></description>
			<author><![CDATA[null@example.com (Thibault)]]></author>
			<pubDate>Thu, 27 Jun 2019 15:48:55 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5242#p5242</guid>
		</item>
	</channel>
</rss>
