Quantcast
Channel: Answers by "Motionreactor"
Viewing all articles
Browse latest Browse all 32

Answer by Motionreactor

$
0
0

Luckily the Unity team have made this really simple:

var dataString: String;
var url = "http://www.mysite.com/data.txt";

function Start () {
    // Start a download of the given URL
    var www : WWW = new WWW(url);

    // Wait for download to complete
    yield www;

    // assign data from URL to string
    dataString = www.data; 
}

function OnGUI() { 
    GUI.Label(Rect(100, 100, 140, 20), dataString); 
}

Reference: http://unity3d.com/support/documentation/ScriptReference/WWW.html


Viewing all articles
Browse latest Browse all 32

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>