This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using UnityEngine; | |
| [Serializable] | |
| public struct HSBColor | |
| { | |
| public float H; | |
| public float S; | |
| public float B; | |
| public float A; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Copy the "System.Drawing.dll" file in the "*\Unity\Editor\Data\Mono\lib\mono\2.0" folder into your "Assets" folder. | |
| 2) Attach this script to any object in your scene. | |
| 3) Change the "loadingGifPath" field of the script, (in the Inspector view), to the path of your Gif file. (this can be relative, from the root project folder (i.e. the parent of the "Assets" folder), or absolute | |
| */ | |
| using System.Collections.Generic; | |
| using System.Drawing; | |
| using System.Drawing.Imaging; | |
| using UnityEngine; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // We need this for parsing the JSON, unless you use an alternative. | |
| // You will need SimpleJSON if you don't use alternatives. | |
| // It can be gotten hither. http://wiki.unity3d.com/index.php/SimpleJSON | |
| using SimpleJSON; | |
| using UnityEngine; | |
| using System.Collections; | |
| public class Translate : MonoBehaviour { | |
| // Should we debug? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma strict | |
| import System; | |
| var start : DateTime; | |
| var stop : DateTime; | |
| var repetitions : int = 5000000; | |
| function Start () { | |
| start = DateTime.Now; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma strict | |
| var url = "url to script"; | |
| function Start () { | |
| // Start a download of the given URL | |
| var www : WWW = new WWW (url); | |
| // Wait for download to complete | |
| yield www; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| public class TextureTest : MonoBehaviour { | |
| public Renderer rend; | |
| // Use this for initialization | |
| private void Awake () { | |
| rend.material.mainTexture = TextureUtility.CamToText (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System; | |
| using System.Collections; | |
| public class ActionTest : MonoBehaviour { | |
| // Use this for initialization | |
| private void Awake () { | |
| string url = "http://google.com"; | |
| StartCoroutine(WaitForRequest(url,(status)=>{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| public class ExampleManager : MonoBehaviour | |
| { | |
| static public ExampleManager sharedManager | |
| { | |
| get | |
| { | |
| return MonoBehaviourUtility.GetManager<ExampleManager>( ref _sharedManager ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // You'll have to call these functions atleast once, on load of the game just to ensure your work isn't being stolen. | |
| using UnityEngine; | |
| using System.Collections; | |
| public class SiteLock { | |
| public static void WWWLock (string Domain) { | |
| Application.ExternalEval("if(document.location.host != '" + Domain + "') { document.location='" + Domain + "'; }"); | |
| } |