<?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 — Adding event trigger to OnlineMapsMarker3D]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=804</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=804&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Adding event trigger to OnlineMapsMarker3D.]]></description>
		<lastBuildDate>Thu, 22 Mar 2018 18:42:46 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Adding event trigger to OnlineMapsMarker3D]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3489#p3489</link>
			<description><![CDATA[<p>Let&#039;s try to solve the problem from the other side.<br />Instead of trying to manipulate markers, just intercept the input.<br />Example:<br /><a href="http://infinity-code.com/atlas/online-maps/pages/InterceptInputExample.html">http://infinity-code.com/atlas/online-m … ample.html</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 22 Mar 2018 18:42:46 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3489#p3489</guid>
		</item>
		<item>
			<title><![CDATA[Re: Adding event trigger to OnlineMapsMarker3D]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3487#p3487</link>
			<description><![CDATA[<p>Thanks for reply. I changed it to following, still it did not work. The tooltip only comes when mouse if hovered not when white dot is brought on top of the marker.</p><div class="codebox"><pre><code>                marker.instance.AddComponent&lt;BoxCollider&gt;();

                EventTrigger.Entry entry = new EventTrigger.Entry();
                entry.eventID = EventTriggerType.PointerEnter;
                entry.callback.AddListener((eventData) =&gt; { MyFunction(); });
                EventTrigger eventTrigger  = marker.instance.AddComponent&lt;EventTrigger&gt; ();
                eventTrigger.triggers.Add (entry);</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Neil)]]></author>
			<pubDate>Thu, 22 Mar 2018 15:47:14 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3487#p3487</guid>
		</item>
		<item>
			<title><![CDATA[Re: Adding event trigger to OnlineMapsMarker3D]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3480#p3480</link>
			<description><![CDATA[<p>Hello.</p><p>1. It does not matter because 2, but should be: <br />marker.instance.AddComponent&lt;BoxCollider&gt;();<br />2. The marker automatically creates a BoxCollider, if it does not have other colliders.<br />3. The marker sets Collider.isTrigger = true. Perhaps this is important.<br />4. Should be: <br />marker.instance.GetComponent&lt;EventTrigger&gt;().Triggers.Add(entry);</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 22 Mar 2018 10:49:10 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3480#p3480</guid>
		</item>
		<item>
			<title><![CDATA[Adding event trigger to OnlineMapsMarker3D]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3477#p3477</link>
			<description><![CDATA[<p>We are trying to add a GvrPointerPhysicsRaycaster so that when the white dot comes over one of the OnlineMapsMarker3D it should trigger the tooltip.&nbsp; For that we have added GvrPointerPhysicsRaycaster to Main camera and then trying to add a collider and event trigger on every OnlineMapsMarker3D that is dynamically generated. However whenever we bring the white dot in front of the mater it does not turn into white circle (which will tell use that the event is triggered.) I am using following code, can you suggest what is the right way to add a event trigger to markers ?<br /></p><div class="codebox"><pre><code>                //Load and instantiate the prefab
                GameObject dynamicPrefab = Resources.Load (icon) as GameObject;

                OnlineMapsMarker3D marker = map3d.AddMarker3D (new Vector2 (lng, lat), dynamicPrefab);

                //Add colider
                var boxCollider = dynamicPrefab.AddComponent&lt;BoxCollider&gt;();
                //ADD EVENT TRIGGER 
                EventTrigger.Entry entry = new EventTrigger.Entry();
                entry.eventID = EventTriggerType.PointerEnter;
                entry.callback.AddListener((eventData) =&gt; { MyFunction(); });
                dynamicPrefab.GetComponent&lt;EventTrigger&gt;().triggers.Add(entry);</code></pre></div><p>PS tooltip comes when I bring mouse over it but not when the raycaster is over it.</p><p><a href="https://developers.google.com/vr/unity/reference/class/GvrPointerPhysicsRaycaster">https://developers.google.com/vr/unity/ … sRaycaster</a></p>]]></description>
			<author><![CDATA[null@example.com (Neil)]]></author>
			<pubDate>Thu, 22 Mar 2018 03:32:51 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3477#p3477</guid>
		</item>
	</channel>
</rss>
