<?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 — Collision between markers]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=273</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=273&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Collision between markers.]]></description>
		<lastBuildDate>Fri, 09 Sep 2016 21:50:49 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Collision between markers]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1230#p1230</link>
			<description><![CDATA[<p>Create your own marker system, for example using uGUI, and you&#039;ll have a separate markers and map.<br />Example:<br /><a href="http://infinity-code.com/atlas/online-maps/pages/uGUICustomMarkerEngineExample.html">http://infinity-code.com/atlas/online-m … ample.html</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 09 Sep 2016 21:50:49 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1230#p1230</guid>
		</item>
		<item>
			<title><![CDATA[Re: Collision between markers]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1229#p1229</link>
			<description><![CDATA[<p>Thank you i will try that.</p><p>Otherwise is there a controller who can draw markers apart from the map texture ?</p>]]></description>
			<author><![CDATA[null@example.com (y.mantegues)]]></author>
			<pubDate>Fri, 09 Sep 2016 15:13:57 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1229#p1229</guid>
		</item>
		<item>
			<title><![CDATA[Re: Collision between markers]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1228#p1228</link>
			<description><![CDATA[<p>I forgot to write:<br />Actually you can use boxcollider2D, but you need to update colliders position manually to make it work.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 09 Sep 2016 15:04:13 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1228#p1228</guid>
		</item>
		<item>
			<title><![CDATA[Re: Collision between markers]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1227#p1227</link>
			<description><![CDATA[<p>When you use GUI Texture Control, markers drawn directly into map texture, so you can not use boxcollider2D.</p><p>Example of how to detect collision of markers (without the colliders):<br /></p><div class="codebox"><pre><code>using System.Linq;
using UnityEngine;

public class DetectMarkersCollision:MonoBehaviour
{
    private void Update()
    {
        CheckMarkersCollision();
    }

    private void CheckMarkersCollision()
    {
        OnlineMapsMarker[] markers = OnlineMaps.instance.markers;
        if (markers.Length &lt; 2) return;

        Rect[] rects = markers.Select(m =&gt; m.screenRect).ToArray();

        for (int i = 0; i &lt; rects.Length - 1; i++)
        {
            Rect rect1 = rects[i];
            for (int j = i + 1; j &lt; rects.Length; j++)
            {
                Rect rect2 = rects[j];
                if (rect1.Overlaps(rect2)) OnCollisionDetected(markers[i], markers[j], i, j);
            }
        }
    }

    private void OnCollisionDetected(OnlineMapsMarker marker1, OnlineMapsMarker marker2, int index1, int index2)
    {
        Debug.Log(&quot;Collision detected between &quot; + index1 + &quot; and &quot; + index2);
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 09 Sep 2016 15:00:07 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1227#p1227</guid>
		</item>
		<item>
			<title><![CDATA[Re: Collision between markers]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1226#p1226</link>
			<description><![CDATA[<p>Sorry english is not my native language ...<br />I use GUI Texture Control, with the built-in marker system.<br />I just want to remove the marker when it collide, so I just want to detect the collision</p><p>Thank you for your fast response</p>]]></description>
			<author><![CDATA[null@example.com (y.mantegues)]]></author>
			<pubDate>Fri, 09 Sep 2016 14:38:11 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1226#p1226</guid>
		</item>
		<item>
			<title><![CDATA[Re: Collision between markers]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1225#p1225</link>
			<description><![CDATA[<p>Hello.</p><p>Your question looks very simple, but, unfortunately, I did not understand anything, except that you want to detect the collision markers.<br />What control do you use?<br />You use built-in or your own marker system?<br />What should happen when the markers are collided?<br />You just want to detect the collision, or to make the markers do not intersect?</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 09 Sep 2016 14:32:59 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1225#p1225</guid>
		</item>
		<item>
			<title><![CDATA[Collision between markers]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1224#p1224</link>
			<description><![CDATA[<p>Hello,<br />I want to make 2 markers collide between them when one move close enough to the other.<br />But when the moving marker move, the collider don&#039;t follow and stay at the origin point. I use boxcollider2D.</p><p>Since it&#039;s not possible to my knowledge to use sprite on the map (they are created &quot;under&quot; the map), this is the only way I find to have moving elements on my map, maybe it&#039;s not the best way to do that ?</p><p>Thanks for help</p>]]></description>
			<author><![CDATA[null@example.com (y.mantegues)]]></author>
			<pubDate>Fri, 09 Sep 2016 14:17:19 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1224#p1224</guid>
		</item>
	</channel>
</rss>
