<?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>C# Lesson Archives - Oxmond Technology</title>
	<atom:link href="https://oxmond.com/category/c-lesson/feed/" rel="self" type="application/rss+xml" />
	<link>https://oxmond.com/category/c-lesson/</link>
	<description>IT Development</description>
	<lastBuildDate>Sat, 15 Oct 2022 08:08:58 +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>iTween Animation Examples</title>
		<link>https://oxmond.com/itween-animation-examples/</link>
					<comments>https://oxmond.com/itween-animation-examples/#respond</comments>
		
		<dc:creator><![CDATA[Oxmond Technology]]></dc:creator>
		<pubDate>Fri, 15 Jan 2021 10:58:13 +0000</pubDate>
				<category><![CDATA[2D]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[C# Lesson]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Unity]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[animations]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[gameobject]]></category>
		<category><![CDATA[itween]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[script animation]]></category>
		<guid isPermaLink="false">https://oxmond.com/?p=906</guid>

					<description><![CDATA[<p>Using iTween animations in your Unity game Need to script an animation in Unity, but can not remember exactly how? Look no further. Here is an overview of the most used iTween animation features. So was is iTween exactly? iTween is a great script animation...</p>
<p>The post <a rel="nofollow" href="https://oxmond.com/itween-animation-examples/">iTween Animation Examples</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>Using iTween animations in your Unity game</strong><br />
Need to script an animation in Unity, but can not remember exactly how? Look no further. Here is an overview of the most used iTween animation features.</p>
<p><strong>So was is iTween exactly?<br />
</strong>iTween is a great script animation framework which you can download for free from the <a href="https://assetstore.unity.com/packages/tools/animation/itween-84?aid=1100l4p9k">Unity Asset Store</a><br />
With iTween you can move, rotate, fade, scale, control variables, colors and more!</p>
<p>If you are new to Unity/iTween or scripting I strongly recommend that you watch the video tutorial first &#8211; otherwise, just have fun with the examples. You&#8217;ll find iTween download links etc. at the bottom of this page.</p>
<hr />
<p><strong>Basic MOVE animation:</strong></p>
<pre>// Move the gameobject to x-position 5.0 in 1 second 
iTween.MoveTo(gameObject, iTween.Hash("x", 5, "time", 1, "islocal", true));    
</pre>
<hr />
<p><strong>Basic SCALE animation:</strong></p>
<pre>// Scale the gameobject to 2.0 in 1 second 
iTween.ScaleTo(gameObject, iTween.Hash("x", 2, "y", 2, "time", 1));
</pre>
<hr />
<p><strong>Basic FADE animation:</strong></p>
<pre>// Fade the gameobject to half transparent in 1 second 
iTween.FadeTo(gameObject, iTween.Hash("alpha", 0.5, "time", 1));
</pre>
<hr />
<p><strong>Basic ROTATE animation:</strong></p>
<pre>// Rotage the gameobject 45 degrees in 2 seconds 
iTween.RotateTo(gameObject, iTween.Hash("z", 45, "time", 2));
</pre>
<hr />
<p><strong>Using EASE IN/EASE OUT:</strong></p>
<pre>// Move gameobject using EASE OUT animation
iTween.MoveTo(gameObject, iTween.Hash("x", 3, "time", 2,"easetype", iTween.EaseType.easeOutElastic));
</pre>
<hr />
<p><strong>Get a list of all the easeTypes in the Inspector:</strong><br />
<img loading="lazy" class="alignnone size-full wp-image-942" src="https://oxmond.com/wp/wp-content/uploads/2021/01/Unity_tutorial_iTween_easetypes.png" alt="" width="272" height="131" /></p>
<pre>// Make a public variable to select the easeType from the inspector:
public iTween.EaseType easeType;

// Using the variable:
iTween.MoveTo(gameObject, iTween.Hash("x", 3, "time", 2,"easetype", easeType));
</pre>
<hr />
<p><strong>Calling a function after the animation using ONCOMPLETE:</strong><br />
(Don&#8217;t forget the &#8220;oncompletetarget&#8221; parameter. Otherwise it won&#8217;t work)</p>
<pre>void OnCompleteExample() {
   // Move the gameobject and call another function when done:
   iTween.MoveTo(gameObject, iTween.Hash("x", 5, "time", 2 ,"oncomplete", "ActionAfterTweenComplete", "oncompletetarget", gameObject));
}

void ActionAfterTweenComplete()    {
   print("Tween is DONE!");
}
</pre>
<hr />
<p><strong>Animation DELAY:</strong></p>
<pre>// Animate the gameobject after 3 seconds:
print("Waiting 3 seconds...");
iTween.MoveTo(gameObject, iTween.Hash("x", 5, "time", 1, "delay", 3, "islocal", true));
</pre>
<hr />
<p><strong>Create animation LOOPS:</strong></p>
<pre>// Animate the gameobject up and down in an endless loop:
iTween.MoveTo(gameObject, iTween.Hash("y", 3, "time", 1.4, "looptype", "pingpong", "easetype", iTween.EaseType.easeInOutQuad));
</pre>
<hr />
<p><strong>Tween a VARIABLE:</strong></p>
<pre>void TweenVariableExample()  {
   // Count to 100 over 3 seconds:
   iTween.ValueTo(gameObject, iTween.Hash("from", 1, "to", 100, "time", 2, "onupdatetarget", gameObject, "onupdate", "UpdateCounter"));
}

void UpdateCounter(int newValue) {
   print(newValue);
}
</pre>
<hr />
<p><strong>Fade/animate COLORS:</strong></p>
<pre>// Will fade the gameObject to RED:
private void TweenToColorToRed()
{
     iTween.ColorTo(myGameObject, Color.red, 1.0f);
}

// Will fade the gameboject to pink hex color:
private void TweenToColorToPinkHex()
{
     Color myColor;
     ColorUtility.TryParseHtmlString("#fc00c4", out myColor);
     iTween.ColorTo(BG, myColor, 1.0f);
}
</pre>
<hr />
<p><strong>STOP tweens/animations:</strong></p>
<pre>// Stop and destroy all tweens on a GAMEOBJECT:
iTween.Stop(gameObject);

// Stop and destroy all tweens in current SCENE:
iTween.Stop();
</pre>
<hr />
<p><strong>Links:</strong></p>
<p>🤓 <strong>Stay sharp! Subscribe to Oxmond Tutorials!</strong><br />
<a href="https://bit.ly/SubscribeOxmondTutorials">https://bit.ly/SubscribeOxmondTutorials</a></p>
<p>✅ <strong>Download iTween (yes, it&#8217;s free):</strong><br />
<a href="https://assetstore.unity.com/packages/tools/animation/itween-84?aid=1100l4p9k">https://assetstore.unity.com/packages/tools/animation/itween-84?aid=1100l4p9k</a></p>
<p>✅ <strong>Download 2D Game Starter Assets from the video tutorial above:<br />
</strong><a href="https://assetstore.unity.com/packages/2d/environments/2d-game-starter-assets-24626?aid=1100l4p9k">https://assetstore.unity.com/packages/2d/environments/2d-game-starter-assets-24626?aid=1100l4p9k</a><strong><br />
</strong></p>
<p>🎱 <strong>More Free Assets from the Unity Assets Store:</strong><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>
<p>Some links might be affiliate links. This means that if you buy something via these links we might get a small payment too.<br />
Thanks for the support, it is truly appreciated so we can keep on making high quality content 😎👍</p>
<hr />
<p>The post <a rel="nofollow" href="https://oxmond.com/itween-animation-examples/">iTween Animation Examples</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://oxmond.com/itween-animation-examples/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Write Time Delays In Your Code! [Beginner Tutorial &#8211; Unity 2020]</title>
		<link>https://oxmond.com/how-to-write-time-delays-in-your-code-beginner-tutorial-unity-2020/</link>
					<comments>https://oxmond.com/how-to-write-time-delays-in-your-code-beginner-tutorial-unity-2020/#comments</comments>
		
		<dc:creator><![CDATA[Oxmond Technology]]></dc:creator>
		<pubDate>Tue, 10 Nov 2020 15:52:31 +0000</pubDate>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[C# Lesson]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Unity]]></category>
		<category><![CDATA[2019]]></category>
		<category><![CDATA[2D]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Beginner Tutorial]]></category>
		<category><![CDATA[Clock]]></category>
		<category><![CDATA[delay]]></category>
		<category><![CDATA[delay action]]></category>
		<category><![CDATA[delay code]]></category>
		<category><![CDATA[delay function call]]></category>
		<category><![CDATA[delay update function]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[execute code after delay]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[future execution]]></category>
		<category><![CDATA[gameobject]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[learn]]></category>
		<category><![CDATA[lesson]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[Oxmond Unity Tutorials]]></category>
		<category><![CDATA[run code after delay]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[sprite]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[timeline]]></category>
		<category><![CDATA[timer]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[Unity 2020]]></category>
		<category><![CDATA[Unity delay 1 second]]></category>
		<category><![CDATA[Unity delay code execution]]></category>
		<category><![CDATA[Unity delay start function]]></category>
		<category><![CDATA[Unity3d]]></category>
		<category><![CDATA[video games]]></category>
		<guid isPermaLink="false">https://oxmond.com/?p=799</guid>

					<description><![CDATA[<p>How to execute code with a delay? In this tutorial we will take a look at how we can delay script or functions in Unity. 🧡 Subscribe to Oxmond Tutorials. Stay tuned! https://bit.ly/SubscribeOxmondTutorials ✅ Free Assets from the Unity Assets Store: https://assetstore.unity.com/lists/top-free-packages-13201?aid=1100l4p9k 😷👕 Need a...</p>
<p>The post <a rel="nofollow" href="https://oxmond.com/how-to-write-time-delays-in-your-code-beginner-tutorial-unity-2020/">How to Write Time Delays In Your Code! [Beginner Tutorial &#8211; Unity 2020]</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>How to execute code with a delay? In this tutorial we will take a look at how we can delay script or functions in Unity.</p>
<hr />
<p>🧡 Subscribe to Oxmond Tutorials. Stay tuned!<br />
<a href="https://bit.ly/SubscribeOxmondTutorials">https://bit.ly/SubscribeOxmondTutorials</a></p>
<p>✅ Free Assets from the Unity Assets Store:<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>
<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>
<p>Some links might be affiliate links. Any support is truly appreciated so we can keep on making high quality content</p>
<p>&nbsp;</p>
<p><strong>The Button script:</strong></p>
<pre>/*
   .-------.                             .--.    .-------.     .--.            .--.     .--.        
   |       |--.--.--------.-----.-----.--|  |    |_     _|--.--|  |_.-----.----|__|---.-|  |-----.
   |   -   |_   _|        |  _  |     |  _  |      |   | |  |  |   _|  _  |   _|  |  _  |  |__ --|
   |_______|__.__|__|__|__|_____|__|__|_____|      |___| |_____|____|_____|__| |__|___._|__|_____|
   © 2018-2020 OXMOND / www.oxmond.com 
*/

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Button : MonoBehaviour
{

    public GameObject textBtnIsClicked;
    public GameObject textDelayedAction;

    private void OnMouseUp()
    {
        textBtnIsClicked.SetActive(true);
        Invoke("Action", 2.0f);
    }

    private void Action()
    {
        textDelayedAction.SetActive(true);
    }

}


</pre>
<p>The post <a rel="nofollow" href="https://oxmond.com/how-to-write-time-delays-in-your-code-beginner-tutorial-unity-2020/">How to Write Time Delays In Your Code! [Beginner Tutorial &#8211; Unity 2020]</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://oxmond.com/how-to-write-time-delays-in-your-code-beginner-tutorial-unity-2020/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<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>
	</channel>
</rss>
