<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Right Click Function for Marker or Drawing??]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1992&amp;type=atom" />
	<updated>2022-06-27T08:49:07Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1992</id>
		<entry>
			<title type="html"><![CDATA[Re: Right Click Function for Marker or Drawing??]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8419#p8419" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Good question. I never thought about it.</p><p>Something like that:<br /></p><div class="codebox"><pre><code>using UnityEngine;

namespace InfinityCode.OnlineMapsSupport
{
    public class RightClickOnInteractiveElement : MonoBehaviour
    {
        private bool isRightPressed = false;
        private IOnlineMapsInteractiveElement pressedElement;

        private void OnRightClick(IOnlineMapsInteractiveElement element)
        {
            Debug.Log(&quot;OnRightClick&quot;);
        }

        private void OnRightPress(IOnlineMapsInteractiveElement element)
        {
            Debug.Log(&quot;OnRightPress&quot;);
        }

        private void OnRightRelease(IOnlineMapsInteractiveElement element)
        {
            Debug.Log(&quot;OnRightRelease&quot;);
        }

        private void Update()
        {
            bool rightPresses = Input.GetMouseButton(1);
            if (rightPresses == isRightPressed) return;

            isRightPressed = rightPresses;
            Vector2 inputPosition = OnlineMapsControlBase.instance.GetInputPosition();
            IOnlineMapsInteractiveElement element = OnlineMapsControlBase.instance.GetInteractiveElement(inputPosition);
            if (element == null) return;

            if (rightPresses)
            {
                pressedElement = element;
                OnRightPress(element);
            }
            else
            {
                OnRightRelease(element);
                if (pressedElement == element) OnRightClick(element);
                pressedElement = null;
            }
        }
    }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2022-06-27T08:49:07Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8419#p8419</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Right Click Function for Marker or Drawing??]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8417#p8417" />
			<content type="html"><![CDATA[<p>Is there a right click function for marker or Drawing???</p>]]></content>
			<author>
				<name><![CDATA[moonflow123]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1980</uri>
			</author>
			<updated>2022-06-27T04:13:24Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8417#p8417</id>
		</entry>
</feed>
