<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Map Update Finished Callback ?]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=546&amp;type=atom" />
	<updated>2018-01-29T00:13:01Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=546</id>
		<entry>
			<title type="html"><![CDATA[Re: Map Update Finished Callback ?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3296#p3296" />
			<content type="html"><![CDATA[<p>This code is still working.<br />But in Online Maps v2.5.14+ it&#039;s easier to use OnlineMapsTile.OnAllTilesLoaded.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2018-01-29T00:13:01Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3296#p3296</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Map Update Finished Callback ?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3293#p3293" />
			<content type="html"><![CDATA[<p>Is this code still what should be used? I was using OnMapUpdated, but it&#039;s getting called multiple times. OnMapCompleteLoaded doesn&#039;t appear to be in the current version.</p>]]></content>
			<author>
				<name><![CDATA[Quidam]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=76</uri>
			</author>
			<updated>2018-01-28T00:42:07Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3293#p3293</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Map Update Finished Callback ?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2358#p2358" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Something like that:<br /></p><div class="codebox"><pre><code>using System;
using UnityEngine;

public class CheckMapCompleteLoaded:MonoBehaviour
{
    public static Action OnMapCompleteLoaded;

    private void Start()
    {
        OnMapCompleteLoaded += () =&gt; Debug.Log(&quot;Complete Loaded&quot;);
        OnlineMaps.instance.OnMapUpdated += OnMapUpdated;
    }

    private void OnMapUpdated()
    {
        lock (OnlineMapsTile.tiles)
        {
            if (OnlineMapsTile.tiles.Count == 0) return;
            foreach (OnlineMapsTile t in OnlineMapsTile.tiles)
            {
                // Check tile status
                // If status == loading or status == none (not started), then wait more
                if (t.status == OnlineMapsTileStatus.loading || t.status == OnlineMapsTileStatus.none) return;
            }
        }

        OnlineMaps.instance.OnMapUpdated -= OnMapUpdated;
        if (OnMapCompleteLoaded != null) OnMapCompleteLoaded();
        Destroy(this);
    }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-05-15T20:23:26Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2358#p2358</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Map Update Finished Callback ?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2354#p2354" />
			<content type="html"><![CDATA[<p>Is there a Callback when the Map has completed it&#039;s update e.g. all tiles have received their coresponding texture (and no gray spots left) ?</p>]]></content>
			<author>
				<name><![CDATA[stefaneischer]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=455</uri>
			</author>
			<updated>2017-05-15T10:47:06Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2354#p2354</id>
		</entry>
</feed>
