Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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
0
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
Add comment
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

· Add your reply
  • Sort: 
avatar image
1
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
Add comment · 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

Your answer

Hint: You can notify a user about this post by typing @username

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

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

New to Raycasts, trouble using "hit" 0 Answers

Animator Controller 0 Answers

Not getting debug.log errors from mysql? 0 Answers

hi guys no idea why I'm getting error CS0117: `UnityEngine.MasterServer' does not contain a definition for `ipAdress' 1 Answer


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