<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>example Archives - Oxmond Technology</title>
	<atom:link href="https://oxmond.com/tag/example/feed/" rel="self" type="application/rss+xml" />
	<link>https://oxmond.com/tag/example/</link>
	<description>IT Development</description>
	<lastBuildDate>Wed, 18 Nov 2020 04:21:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0.2</generator>
	<item>
		<title>How to read JSON data from a web service in C#</title>
		<link>https://oxmond.com/how-to-read-json-data-from-a-web-service-in-c/</link>
					<comments>https://oxmond.com/how-to-read-json-data-from-a-web-service-in-c/#comments</comments>
		
		<dc:creator><![CDATA[Oxmond Technology]]></dc:creator>
		<pubDate>Tue, 17 Sep 2019 13:05:52 +0000</pubDate>
				<category><![CDATA[C# Lesson]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Unity]]></category>
		<category><![CDATA[2019]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[coding pirates]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[Hans Oxmond]]></category>
		<category><![CDATA[Henrik Poulsen]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[How to get JSON data from a web service in Unity]]></category>
		<category><![CDATA[How to read a JSON file in Unity]]></category>
		<category><![CDATA[How to read JSON data from a web service in C#]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[Import JSON file]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[json file]]></category>
		<category><![CDATA[json list]]></category>
		<category><![CDATA[json object]]></category>
		<category><![CDATA[json parser]]></category>
		<category><![CDATA[jsonobject]]></category>
		<category><![CDATA[jsonutility]]></category>
		<category><![CDATA[learn]]></category>
		<category><![CDATA[lesson]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[loading]]></category>
		<category><![CDATA[Oxmond Unity Tutorials]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[read]]></category>
		<category><![CDATA[reading]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[SimpleJSON]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Unity3d]]></category>
		<category><![CDATA[video games]]></category>
		<category><![CDATA[web]]></category>
		<guid isPermaLink="false">https://oxmond.com/?p=608</guid>

					<description><![CDATA[<p>How to read a JSON data from a web service in Unity. This Tutorial is about reading JSON data. We will build a little application build on a JSON webservice. ✅ Download the free SimpleJSON parser: https://github.com/HenrikPoulsen/SimpleJSON ✅ The free geoplugin webservice: http://www.geoplugin.net/json.gp?ip=213.22.22.98 ❤️ Subscribe...</p>
<p>The post <a rel="nofollow" href="https://oxmond.com/how-to-read-json-data-from-a-web-service-in-c/">How to read JSON data from a web service in C#</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>How to read a JSON data from a web service in Unity. This Tutorial is about reading JSON data. We will build a little application build on a JSON webservice.</p>
<hr />
<p>✅ Download the free SimpleJSON parser:<br />
<a href="https://github.com/HenrikPoulsen/SimpleJSON">https://github.com/HenrikPoulsen/SimpleJSON</a></p>
<p>✅ The free geoplugin webservice:<br />
<a href="http://www.geoplugin.net/json.gp?ip=213.22.22.98">http://www.geoplugin.net/json.gp?ip=213.22.22.98</a></p>
<hr />
<p>❤️ Subscribe to Oxmond Tutorials. New tutorials every day! Stay tuned!<br />
<a href="https://bit.ly/SubscribeOxmondTutorials">https://bit.ly/SubscribeOxmondTutorials</a></p>
<p>🔔 Remember to hit that little bell to turn on notifications!</p>
<p>😷👕 Need a face mask / developer T-shirt? Drop by our shop and get a 20% DISCOUNT on your first purchase by using the discount code OXMONDSALE. Click here:<br />
<a href="https://shop.oxmond.com/discount/OXMONDSALE">https://shop.oxmond.com/discount/OXMONDSALE</a></p>
<hr />
<p>✅ Download free assets from the Unity Assets Store for your game:<br />
<a href="https://assetstore.unity.com/lists/top-free-packages-13201?aid=1100l4p9k">https://assetstore.unity.com/lists/top-free-packages-13201?aid=1100l4p9k</a></p>
<hr />
<p><strong>The LoadJSON script:</strong></p>
<pre>/*

   .-------.                             .--.    .-------.     .--.            .--.     .--.        
   |       |--.--.--------.-----.-----.--|  |    |_     _|--.--|  |_.-----.----|__|---.-|  |-----.
   |   -   |_   _|        |  _  |     |  _  |      |   | |  |  |   _|  _  |   _|  |  _  |  |__ --|
   |_______|__.__|__|__|__|_____|__|__|_____|      |___| |_____|____|_____|__| |__|___._|__|_____|
   © 2019 OXMOND / www.oxmond.com 

*/

using System.Collections;
using UnityEngine;
using SimpleJSON;
using UnityEngine.Networking;
using TMPro;

public class LoadJSON : MonoBehaviour
{

    public TMP_InputField inputTxt;
    public TMP_Text countryTxt;
    public TMP_Text continentTxt;

    public void GetJsonData()
    {
        StartCoroutine(RequestWebService());
    }

    IEnumerator RequestWebService()
    {
        string getDataUrl = "http://www.geoplugin.net/json.gp?ip=" + inputTxt.text;
        print(getDataUrl);

        using (UnityWebRequest webData = UnityWebRequest.Get(getDataUrl))
        {

            yield return webData.SendWebRequest();
            if (webData.isNetworkError || webData.isHttpError)
            {
                print("---------------- ERROR ----------------");
                print(webData.error);
            }
            else
            {
                if (webData.isDone)
                {
                    JSONNode jsonData = JSON.Parse(System.Text.Encoding.UTF8.GetString(webData.downloadHandler.data));

                    if (jsonData == null)
                    {
                        print("---------------- NO DATA ----------------");
                    }
                    else
                    {
                        print("---------------- JSON DATA ----------------");
                        print("jsonData.Count:" + jsonData.Count);
                        countryTxt.text = jsonData["geoplugin_countryName"];
                        continentTxt.text = jsonData["geoplugin_continentName"];
                    }
                }
            }
        }
    }
}

</pre>
<p>The post <a rel="nofollow" href="https://oxmond.com/how-to-read-json-data-from-a-web-service-in-c/">How to read JSON data from a web service in C#</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://oxmond.com/how-to-read-json-data-from-a-web-service-in-c/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How To Build a Video Player With Scrub Control in Unity!</title>
		<link>https://oxmond.com/how-to-build-a-video-player-with-scrub-control-in-unity/</link>
					<comments>https://oxmond.com/how-to-build-a-video-player-with-scrub-control-in-unity/#comments</comments>
		
		<dc:creator><![CDATA[Oxmond Technology]]></dc:creator>
		<pubDate>Fri, 06 Sep 2019 16:11:18 +0000</pubDate>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Unity]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[2019]]></category>
		<category><![CDATA[2D]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Asteroids]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[building]]></category>
		<category><![CDATA[building a videoplayer]]></category>
		<category><![CDATA[coding pirates]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[controls]]></category>
		<category><![CDATA[engine]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[Hans Oxmond]]></category>
		<category><![CDATA[How To Build a Video Player With Scrub Control in Unity]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[overview]]></category>
		<category><![CDATA[Oxmond Unity Tutorials]]></category>
		<category><![CDATA[pause]]></category>
		<category><![CDATA[play]]></category>
		<category><![CDATA[playback]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[scrub]]></category>
		<category><![CDATA[scrub control for unity video player]]></category>
		<category><![CDATA[scrubbing]]></category>
		<category><![CDATA[seek]]></category>
		<category><![CDATA[seek with video player]]></category>
		<category><![CDATA[streaming]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[Unity3d]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[video controls]]></category>
		<category><![CDATA[video pause]]></category>
		<category><![CDATA[video player]]></category>
		<category><![CDATA[video player controls]]></category>
		<category><![CDATA[video ui]]></category>
		<category><![CDATA[videoplayer]]></category>
		<category><![CDATA[videoplayer control]]></category>
		<guid isPermaLink="false">https://oxmond.com/?p=591</guid>

					<description><![CDATA[<p>In this tutorial we build our own video player. Complete with play &#38; pause buttons and a nice scrub bar controller. What&#8217;s not to like? 😛 ✅ Download the files and scripts from the tutorial here: oxmond.com/download/tutorials/unity/Oxmond_videoplayer.unitypackage ✅ Download free assets from the Unity Assets...</p>
<p>The post <a rel="nofollow" href="https://oxmond.com/how-to-build-a-video-player-with-scrub-control-in-unity/">How To Build a Video Player With Scrub Control in Unity!</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In this tutorial we build our own video player. Complete with play &amp; pause buttons and a nice scrub bar controller. What&#8217;s not to like? 😛</p>
<hr />
<p>✅ <strong>Download the files and scripts from the tutorial here:<br />
</strong><a href="https://oxmond.com/download/tutorials/unity/Oxmond_videoplayer.unitypackage" target="_blank" rel="noopener noreferrer">oxmond.com/download/tutorials/unity/Oxmond_videoplayer.unitypackage</a></p>
<hr />
<p>✅ <strong>Download free assets from the Unity Assets Store:</strong><br />
<a href="https://assetstore.unity.com/lists/top-free-packages-13201?aid=1100l4p9k" target="_blank" rel="noopener noreferrer">https://assetstore.unity.com/lists/top-free-packages-13201?aid=1100l4p9k</a></p>
<hr />
<p>❤️ <strong>Subscribe to Oxmond Tutorials. Stay ahead of the game!</strong><br />
<a href="https://bit.ly/SubscribeOxmondTutorials">https://bit.ly/SubscribeOxmondTutorials</a></p>
<hr />
<p>😷👕 <strong>Need a face mask / developer T-shirt? Drop by our shop and get a 20% DISCOUNT on your first purchase by using the discount code OXMONDSALE. Click here:</strong><br />
<a href="https://shop.oxmond.com/discount/OXMONDSALE">https://shop.oxmond.com/discount/OXMONDSALE</a></p>
<hr />
<p><strong>MyVideoPlayer script:</strong></p>
<pre>/*

   .-------.                             .--.    .-------.     .--.            .--.     .--.        
   |       |--.--.--------.-----.-----.--|  |    |_     _|--.--|  |_.-----.----|__|---.-|  |-----.
   |   -   |_   _|        |  _  |     |  _  |      |   | |  |  |   _|  _  |   _|  |  _  |  |__ --|
   |_______|__.__|__|__|__|_____|__|__|_____|      |___| |_____|____|_____|__| |__|___._|__|_____|
   © 2019 OXMOND / www.oxmond.com 

*/

using UnityEngine;
using UnityEngine.Video;
using System.Collections;

public class MyVideoPlayer : MonoBehaviour
{

    public GameObject cinemaPlane;
    public GameObject btnPlay;
    public GameObject btnPause;
    public GameObject knob;
    public GameObject progressBar;
    public GameObject progressBarBG;

    private float maxKnobValue;
    private float newKnobX;
    private float maxKnobX;
    private float minKnobX;
    private float knobPosY;
    private float simpleKnobValue;
    private float knobValue;
    private float progressBarWidth;
    private bool knobIsDragging;
    private bool videoIsJumping = false;
    private bool videoIsPlaying = false;
    private VideoPlayer videoPlayer;
    
    private void Start  ()
    {
        knobPosY = knob.transform.localPosition.y;
        videoPlayer = GetComponent();
        btnPause.SetActive(true);
        btnPlay.SetActive(false);
        videoPlayer.frame = (long)100;
        progressBarWidth = progressBarBG.GetComponent().bounds.size.x;
    }

    private void Update()
    {
        if (!knobIsDragging &amp;&amp; !videoIsJumping)
        {
            if (videoPlayer.frameCount &gt; 0)
            {
                float progress = (float)videoPlayer.frame / (float)videoPlayer.frameCount;
                progressBar.transform.localScale = new Vector3(progressBarWidth * progress, progressBar.transform.localScale.y, 0);
                knob.transform.localPosition = new Vector2(progressBar.transform.localPosition.x + (progressBarWidth * progress), knob.transform.localPosition.y);
            }
        }

        if (Input.GetMouseButtonDown(0))
        {
            Vector3 pos = Input.mousePosition;
            Collider2D hitCollider = Physics2D.OverlapPoint(Camera.main.ScreenToWorldPoint(pos));
            
            if (hitCollider != null &amp;&amp; hitCollider.CompareTag(btnPause.tag))
            {
                BtnPlayVideo();
            }
            if (hitCollider != null &amp;&amp; hitCollider.CompareTag(btnPlay.tag))
            {
                print("playBtn");
                BtnPlayVideo();
            }
        }
    }

    public void KnobOnPressDown()
    {
        VideoStop();
        minKnobX = progressBar.transform.localPosition.x;
        maxKnobX = minKnobX + progressBarWidth;
    }

    public void KnobOnRelease()
    {
        knobIsDragging = false;
        CalcKnobSimpleValue();
        VideoPlay();
        VideoJump();
        StartCoroutine(DelayedSetVideoIsJumpingToFalse());
    }

    IEnumerator DelayedSetVideoIsJumpingToFalse()
    {
        yield return new WaitForSeconds(2);
        SetVideoIsJumpingToFalse();
    }

    public void KnobOnDrag()
    {
        knobIsDragging = true;
        videoIsJumping = true;
        Vector3 curScreenPoint = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
        Vector3 curPosition = Camera.main.ScreenToWorldPoint(curScreenPoint);
        knob.transform.position = new Vector2(curPosition.x, curPosition.y);
        newKnobX = knob.transform.localPosition.x;
        if (newKnobX &gt; maxKnobX) { newKnobX = maxKnobX; }
        if (newKnobX &lt; minKnobX) { newKnobX = minKnobX; }
        knob.transform.localPosition = new Vector2(newKnobX, knobPosY);
        CalcKnobSimpleValue();
        progressBar.transform.localScale = new Vector3(simpleKnobValue * progressBarWidth, progressBar.transform.localScale.y, 0);
    }

    private void SetVideoIsJumpingToFalse()
    {
        videoIsJumping = false;
    }

    private void CalcKnobSimpleValue()
    {
        maxKnobValue = maxKnobX - minKnobX;
        knobValue = knob.transform.localPosition.x - minKnobX;
        simpleKnobValue = knobValue / maxKnobValue;
    }

    private void VideoJump()
    {
        var frame = videoPlayer.frameCount * simpleKnobValue;
        videoPlayer.frame = (long)frame;
    }

    private void BtnPlayVideo()
    {
        if (videoIsPlaying)
        {
            VideoStop();
        }
        else
        {
            VideoPlay();
        }
    }

    private void VideoStop()
    {
        videoIsPlaying = false;
        videoPlayer.Pause();
        btnPause.SetActive(false);
        btnPlay.SetActive(true);
    }

    private void VideoPlay()
    {
        videoIsPlaying = true;
        videoPlayer.Play();
        btnPause.SetActive(true);
        btnPlay.SetActive(false);
    }
}
</pre>
<hr />
<p><strong>The Knob Script:</strong></p>
<pre>using UnityEngine;

// [RequireComponent(typeof(MeshCollider))]
/*

   .-------.                             .--.    .-------.     .--.            .--.     .--.        
   |       |--.--.--------.-----.-----.--|  |    |_     _|--.--|  |_.-----.----|__|---.-|  |-----.
   |   -   |_   _|        |  _  |     |  _  |      |   | |  |  |   _|  _  |   _|  |  _  |  |__ --|
   |_______|__.__|__|__|__|_____|__|__|_____|      |___| |_____|____|_____|__| |__|___._|__|_____|
   © 2019 OXMOND / www.oxmond.com 

*/

public class Knob : MonoBehaviour
{
    public GameObject videoPlayer;
    private MyVideoPlayer videoPlayerScript;

    void Start()
    {
        videoPlayerScript = videoPlayer.GetComponent();
    }

    void OnMouseDown()
    {
        videoPlayerScript.KnobOnPressDown();
    }

    void OnMouseUp()
    {
        videoPlayerScript.KnobOnRelease();
    }

    void OnMouseDrag()
    {
        videoPlayerScript.KnobOnDrag();
    }

}

</pre>
<p>The post <a rel="nofollow" href="https://oxmond.com/how-to-build-a-video-player-with-scrub-control-in-unity/">How To Build a Video Player With Scrub Control in Unity!</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://oxmond.com/how-to-build-a-video-player-with-scrub-control-in-unity/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>How To Drag and Drop a 2D Object</title>
		<link>https://oxmond.com/how-to-drag-and-drop-a-2d-object/</link>
					<comments>https://oxmond.com/how-to-drag-and-drop-a-2d-object/#comments</comments>
		
		<dc:creator><![CDATA[Oxmond Technology]]></dc:creator>
		<pubDate>Sun, 18 Aug 2019 19:32:12 +0000</pubDate>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Unity]]></category>
		<category><![CDATA[2D]]></category>
		<category><![CDATA[Beginner Tutorial - Unity 2019]]></category>
		<category><![CDATA[coding pirates]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[drag]]></category>
		<category><![CDATA[drag and drop]]></category>
		<category><![CDATA[drag and drop example]]></category>
		<category><![CDATA[drag gameobject with mouse]]></category>
		<category><![CDATA[drop]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[free lesson]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[game object]]></category>
		<category><![CDATA[gameobject]]></category>
		<category><![CDATA[Hans Oxmond]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[instruction]]></category>
		<category><![CDATA[learn]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[Oxmond Unity Tutorials]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sprite]]></category>
		<category><![CDATA[target]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[unity 2019]]></category>
		<category><![CDATA[Unity3d]]></category>
		<category><![CDATA[video games]]></category>
		<guid isPermaLink="false">https://oxmond.com/?p=501</guid>

					<description><![CDATA[<p>Learn how to drag a 2D object with the mouse. In this tutorial we will create at general drag and drop script you can use on any sprite.  ❤️ Subscribe to Oxmond Tutorials. Stay ahead of the game: https://bit.ly/SubscribeOxmondTutorials ✅ Download the free Japanese Dishes...</p>
<p>The post <a rel="nofollow" href="https://oxmond.com/how-to-drag-and-drop-a-2d-object/">How To Drag and Drop a 2D Object</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><span style="font-weight: 400;">Learn how to drag a 2D object with the mouse. In this tutorial we will create at general drag and drop script you can use on any sprite. </span></p>
<hr />
<p><span style="font-weight: 400;">❤️ <strong>Subscribe to Oxmond Tutorials. Stay ahead of the game:</strong></span><span style="font-weight: 400;"><br />
</span><a href="https://bit.ly/SubscribeOxmondTutorials"><span style="font-weight: 400;">https://bit.ly/SubscribeOxmondTutorials</span></a></p>
<p><span style="font-weight: 400;"> ✅ <strong>Download the free Japanese Dishes sprites here:</strong></span><span style="font-weight: 400;"><br />
</span><a href="https://assetstore.unity.com/packages/2d/textures-materials/food/japanese-dishes-82383?aid=1100l4p9k"><span style="font-weight: 400;">https://assetstore.unity.com/packages/2d/textures-materials/food/japanese-dishes-82383?aid=1100l4p9k </span></a></p>
<p><span style="font-weight: 400;"><strong>✅ Other Free Assets in the Unity Assets Store:<br />
</strong></span><a href="https://assetstore.unity.com/lists/top-free-packages-13201?aid=1100l4p9k"><span style="font-weight: 400;">https://assetstore.unity.com/lists/top-free-packages-13201?aid=1100l4p9k </span></a></p>
<p>😷👕 <strong>Need a face mask / developer T-shirt? Drop by our shop and get a 20% DISCOUNT on your first purchase by using the discount code OXMONDSALE. Click here:</strong><br />
<a href="https://shop.oxmond.com/discount/OXMONDSALE">https://shop.oxmond.com/discount/OXMONDSALE</a></p>
<hr />
<p><strong>The DragAndDrop script:</strong></p>
<pre>/*
   .-------.                             .--.    .-------.     .--.            .--.     .--.        
   |       |--.--.--------.-----.-----.--|  |    |_     _|--.--|  |_.-----.----|__|---.-|  |-----.
   |   -   |_   _|        |  _  |     |  _  |      |   | |  |  |   _|  _  |   _|  |  _  |  |__ --|
   |_______|__.__|__|__|__|_____|__|__|_____|      |___| |_____|____|_____|__| |__|___._|__|_____|
   © 2019 OXMOND / www.oxmond.com 
*/

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DragAndDrop : MonoBehaviour
{

    private bool isDragging;

    public void OnMouseDown()
    {
        isDragging = true;
    }

    public void OnMouseUp()
    {
        isDragging = false;
    }

    void Update()
    {
        if (isDragging) {
            Vector2 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position;
            transform.Translate(mousePosition);
        }
    }
}
</pre>
<p>The post <a rel="nofollow" href="https://oxmond.com/how-to-drag-and-drop-a-2d-object/">How To Drag and Drop a 2D Object</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://oxmond.com/how-to-drag-and-drop-a-2d-object/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
