Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

How to make a game Feed with Dropbox

Discussion in 'Community Learning & Teaching' started by DryTear, Jul 14, 2013.

  1. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    You will need a Dropbox account for this.

    Step 1 : Create a public folder
    Step 2 : Download THIS file, and then upload it inside your Public Folder

    The file you are downloading is crossdomain.xml, this allows WebPlayer to access servers and websites.

    Step 3 : Copy Public link of crossdomain.xml
    Step 4 : Inside Unity3D Go to Edit > ProjectSettings > Editor
    Step 5 : Set the WWW Security Emulation, to the public link that you've copied
    Step 6 : Install Dropbox Desktop client (Skip if you already have it)
    Step 7 : Inside the public folder, create a new text file called Feed.txt
    Step 8 : Write some stuff there.
    Step 9 : Create a new script, and attach it to any GameObject :

    Feed.js
    Code (csharp):
    1.  
    2. var url = "http://www.YourServer.com/somefile.txt";
    3. var myText : String;
    4. var MySkin : GUISkin;
    5.  
    6. @script AddComponentMenu ("Utilities/Feed")
    7.  
    8. function Start ()
    9. {
    10.     var guiwww : WWW = new WWW(url);
    11.     yield guiwww;
    12.     myText = guiwww.text;
    13. }
    14.  
    15. function OnGUI()
    16. {
    17.     GUI.skin = MySkin;
    18.     GUI.Box(Rect(5,5,Screen.width-90,20), "");
    19.     GUI.Label(Rect(10,5,2000,30), myText);
    20. }
    21.  
    Step 10 : Copy public link of the Feed.txt and paste it onto the url variable of the Feed Script
    Step 11 : Run game, check if what was written in the Text file same as in the game.

    Tip : Do not re upload new Feed.txt files, instead edit them with the Dropbox Desktop client.
     
    Wang-Steve likes this.
  2. joshua-jebadurai

    joshua-jebadurai

    Joined:
    Jul 3, 2009
    Posts:
    14
    You're awesome!