<?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 — Playmaker Action: Get Center Point And Best Zoom between Coords]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=151</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=151&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Playmaker Action: Get Center Point And Best Zoom between Coords.]]></description>
		<lastBuildDate>Thu, 05 May 2016 00:52:49 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Playmaker Action: Get Center Point And Best Zoom between Coords]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=662#p662</link>
			<description><![CDATA[<p>Hello.</p><p>Many thanks.<br />We have slightly modified it to work with 2+ coordinates.<br />Online Maps v2.4.0.33+ will have this action.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 05 May 2016 00:52:49 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=662#p662</guid>
		</item>
		<item>
			<title><![CDATA[Playmaker Action: Get Center Point And Best Zoom between Coords]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=658#p658</link>
			<description><![CDATA[<p>Hi I added a new playmaker action&nbsp; Get Center Point And Best Zoom between Coords, I include here for the community.</p><div class="codebox"><pre><code>using System.Collections.Generic;
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
    [ActionCategory(OnlineMapsCategories.UTILS)]
    [Tooltip(&quot;Get Center Point And Best Zoom between Coords&quot;)]
    public class GetCenterPointAndBestZoomForCoords : FsmStateAction
    {
        [RequiredField]
        [Tooltip(&quot;Coord 1&quot;)]
        public FsmVector2 coord1;

        [RequiredField]
        [Tooltip(&quot;Coord 2&quot;)]
        public FsmVector2 coord2;

        [RequiredField]
        [UIHint(UIHint.Variable)]
        [Tooltip(&quot;Center coint coordinate (X - Lng, Y - Lat)&quot;)]
        public FsmVector2 storeCenterPoint;

        [UIHint(UIHint.Variable)]
        [Tooltip(&quot;Best zoom&quot;)]
        public FsmInt storeZoom;

        public override void Reset()
        {
            coord1 = null;
            coord2 = null;
            storeCenterPoint = null;
            storeZoom = null;
        }

        public override void OnEnter()
        {
            DoEnter();
            Finish();
        }

        private void DoEnter()
        {
            if (OnlineMaps.instance == null)
            {
                Debug.LogError(&quot;Online Maps not found.&quot;);
                return;
            }

            Vector2 center;
            int zoom;
            OnlineMapsUtils.GetCenterPointAndZoom(new[] {coord2.Value, coord1.Value}, out center, out zoom);

            storeCenterPoint.Value = center;
            storeZoom.Value = zoom;
        }
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (gus)]]></author>
			<pubDate>Wed, 04 May 2016 20:19:19 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=658#p658</guid>
		</item>
	</channel>
</rss>
