<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Toggle Buildings/Traffic On/Off]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2035&amp;type=atom" />
	<updated>2022-09-24T11:27:57Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=2035</id>
		<entry>
			<title type="html"><![CDATA[Re: Toggle Buildings/Traffic On/Off]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8622#p8622" />
			<content type="html"><![CDATA[<p>Got it going.&nbsp; Thank you very much for the assistance.&nbsp; For noobs like me, here is the script I created:</p><div class="codebox"><pre><code> using UnityEngine;

namespace InfinityCode.OnlineMapsDemos
{
    [AddComponentMenu(&quot;Infinity Code/Online Maps/Demos/OverlayMaps&quot;)]
    public class OverlayMaps : MonoBehaviour
    {
        public void TrafficToggle()
        {
            OnlineMaps.instance.traffic = !OnlineMaps.instance.traffic;
        }

        public void BuildingToggle()
        {
            OnlineMapsBuildings.instance.enabled = !OnlineMapsBuildings.instance.enabled;
        }

    }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[jnicol]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1903</uri>
			</author>
			<updated>2022-09-24T11:27:57Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8622#p8622</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Toggle Buildings/Traffic On/Off]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8592#p8592" />
			<content type="html"><![CDATA[<p>Hello.</p><p>To enable/disable traffic, simply set the appropriate flag (OnlineMaps.traffic).<br /><a href="https://infinity-code.com/doxygen/online-maps/classOnlineMaps.html#a9eccf8d208b40f54ced486960013083d">https://infinity-code.com/doxygen/onlin … 960013083d</a></p><p>To enable/disable buildings, enable/disable Online Maps Buildings component.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2022-09-18T14:51:38Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8592#p8592</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Toggle Buildings/Traffic On/Off]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8591#p8591" />
			<content type="html"><![CDATA[<p>Looks like I can&#039;t post the second image, but it is the UI that appears when you add the Demo script as a component to the Map GameObject in Unity.</p>]]></content>
			<author>
				<name><![CDATA[jnicol]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1903</uri>
			</author>
			<updated>2022-09-17T18:31:17Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8591#p8591</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Toggle Buildings/Traffic On/Off]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8590#p8590" />
			<content type="html"><![CDATA[<p>Hi,</p><p>I have been trying to implement this functionality in a menu.&nbsp; (see pix) Got Zoom in and out going using the ZoomArea demo script.&nbsp; I have looked at the Demo script and see that there is an option to toggle traffic on/off.&nbsp; Just not sure how to implement using a button on the UI.&nbsp; </p><p>I have dragged the Map GameObject over to the On Click () function for the button and then selected the Demo, SetTraffic() function which then creates the Demo.SetTraffic function.&nbsp; (see image).&nbsp; This does not present a boolean or other option to turn this on or off so this does not work for me so I am not implementing it correctly and not sure where to go from here.&nbsp; </p><p>I think the Buildings toggle on/off would be a bit more involved.&nbsp; I am trying to turn it on or off for the building streaming on the UI to basically declutter the map if required.&nbsp; Any links to examples or posts would be greatly appreciated.&nbsp; </p><p>Not trying to get anyone to do my work, just a push in the right direction would be great!</p><p>Cheers<br />John</p>]]></content>
			<author>
				<name><![CDATA[jnicol]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1903</uri>
			</author>
			<updated>2022-09-17T18:28:56Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8590#p8590</id>
		</entry>
</feed>
