x


Downloading files in the Editor

I am trying to download files in the editor itself. However I am getting nothing from it.

Here is my js code so far

class MyTestWindow extends EditorWindow {
    var myString : String;

    @MenuItem ("MyTestWindow/Check For Updates")
    static function Init () {

        var window : MyTestWindow = EditorWindow.GetWindow (MyTestWindow);
        window.Show ();
    }

    function OnGUI () {
        EditorGUILayout.TextArea(myString, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
    }

    function GetPage()
    {
        var www : WWW = new WWW("http://google.com");
        yield www;
        myString = www.data;
    }
}

Thank you

more ▼

asked Jun 28 '10 at 11:14 AM

Botto gravatar image

Botto
1 1 1 3

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

Not sure, but I guess www won't work in the editor because Coroutines depend on the game loop and update being called regularly, which doesn't happen in the editor.

more ▼

answered Jun 28 '10 at 11:24 AM

StephanK gravatar image

StephanK
6k 40 53 93

(comments are locked)
10|3000 characters needed characters left

You all should check and learn codes from BundleLoader By Different Methods provided free on Unity Store.

This extension provides a clean and transparent API for downloading and caching asset bundles to the local hard disk. Years of hard lessons have been bundled into one very useful script!

Try visit at BundleLoader page

more ▼

answered Apr 06 '11 at 04:54 PM

Semut gravatar image

Semut
95 4 4 12

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1725
x544
x199

asked: Jun 28 '10 at 11:14 AM

Seen: 846 times

Last Updated: Jun 28 '10 at 01:03 PM