<?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 — uGUICustomMarkerEngineExample Crashing on Type Cast]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=349</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=349&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in uGUICustomMarkerEngineExample Crashing on Type Cast.]]></description>
		<lastBuildDate>Wed, 28 Dec 2016 17:37:34 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: uGUICustomMarkerEngineExample Crashing on Type Cast]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1586#p1586</link>
			<description><![CDATA[<p>Hi Alex, </p><p>Thanks for the response. My issue was that the Prefab was not a UI Element. I have it working now!</p>]]></description>
			<author><![CDATA[null@example.com (junctioniv)]]></author>
			<pubDate>Wed, 28 Dec 2016 17:37:34 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1586#p1586</guid>
		</item>
		<item>
			<title><![CDATA[Re: uGUICustomMarkerEngineExample Crashing on Type Cast]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1554#p1554</link>
			<description><![CDATA[<p>Hello</p><p>Using this example, you need to specify two fields:<br />Marker Container - GameObject, which will contain markers. It must be a Canvas or child GameObject.<br />Marker Prefab - UI element that will be drawn as a marker.</p><p>So there you have one of two problems:<br />Marker Container is not canvas or child GameObject.<br />Marker Prefab is not UI element.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 21 Dec 2016 08:22:40 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1554#p1554</guid>
		</item>
		<item>
			<title><![CDATA[uGUICustomMarkerEngineExample Crashing on Type Cast]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1551#p1551</link>
			<description><![CDATA[<p>I am trying to use the uGUICustomMarkerEngineExample but the script crashes from a null reference exception.&nbsp; In the AddMarkerAddMarker(double lng, double lat, string text) function the following code is causing this error:<br /></p><div class="codebox"><pre><code>public static uGUICustomMarkerExample AddMarker(double lng, double lat, string text)
{
     GameObject markerGameObject = Instantiate(_instance.markerPrefab) as GameObject;
     (markerGameObject.transform as RectTransform).SetParent(_instance.markerContainer);
     ...
}</code></pre></div><p>Casting markerGameObject.transform as RectTransform dynamically returns null and then calling .SetParent(...) on a null value crashed the script.</p><p>I tried attaching this script to the map object in the Demo Scene and set the markerPrefab and the markerContainer in the editor.<br />I also noted that markerGameObject.transform is a non-null Transform object prior to the cast. Is there any reason why this cast is returning null?</p><p>Tested this issue using Unity 5.4.1f1 and OnlineMaps versions 2.5.1.1 and 2.5.1.2</p>]]></description>
			<author><![CDATA[null@example.com (junctioniv)]]></author>
			<pubDate>Tue, 20 Dec 2016 21:45:21 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1551#p1551</guid>
		</item>
	</channel>
</rss>
