• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by zak666 · Oct 24, 2017 at 01:30 AM · wwwscriptingbasicsdropbox

getting the content of a text.doc? (dropbox)

Hey gang, So I made this script in a attempt to see if I can get the content of a text file to see if a user has the current version (hosted on dropbox) though I'm getting a hole bunch of code in my Debug and not just the "1.1" inside the doc? It downloads and stuff but i get a Giant string rather then getting the 1.1, my idea was to check if its the version is not the same thats in the text-doc to prompt the player to a download page for the new version.

 using UnityEngine;
 using UnityEngine.UI;
 
 public class UpdateGame : MonoBehaviour {
 
     public GameObject PleaseUpdate;
     public bool NoUpdateNeed;
 
     IEnumerator Start(){
         WWW Update = new WWW ("https://www.dropbox.com/s/99b8zns097lol93/1.1.text?dl=0");
         yield return Update;
         string update = Update.text;
         Debug.Log( ""+ update );
 
         if (update == "1.1") {
             PleaseUpdate.SetActive(false);
             NoUpdateNeed = true;
         } else {
             PleaseUpdate.SetActive(true);
             NoUpdateNeed = false;
         }
 
     }
 
 
     public void UpdateGameButton(){
         Application.OpenURL ("http://www.mysite.com.downloads"); //Download URL for new Version
     }
 }
Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
Best Answer

Answer by Bunny83 · Oct 24, 2017 at 01:50 AM

Uhm, don't use a "doc" file. A doc file has massive amount of metadata and formatting information included. Use a simple raw format like a txt file. Though in most cases it's more common to use something like json, however if you just want to specify a version string using a text file should work.

Be aware that comparing the string directly might not work if you have a new line or space after your number


edit

I just realised that you used the "download link". You have to either set "?dl=1" at the end or replace it with "?raw=1"

Comment
zak666

People who like this

1 Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image zak666 · Oct 24, 2017 at 02:13 AM 0
Share

It is a text file, called 1.1 and inside is just 1.1 I'm getting as a string a html thats like a bag e long for some reason rather then just the 1.1 :)

avatar image zak666 · Oct 24, 2017 at 02:16 AM 0
Share

alt text

screen-shot-2017-10-24-at-11449-pm.png (216.9 kB)
avatar image Bunny83 zak666 · Oct 24, 2017 at 02:18 AM 0
Share

I've edited my answer.

avatar image zak666 Bunny83 · Oct 24, 2017 at 02:24 AM 0
Share

Awesome like magic thanks m8

Show more comments

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

78 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Dropbox check for game version? using WWW? get 1 page debug insted of 0.1? 0 Answers

how to check subscriptions google play (android unity) on start? 0 Answers

using WWW to upload prefabs/game objects in webplayer... help 1 Answer

yield return WWW; not returning 1 Answer

WWW 'PUT' method? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges