Search Unity

Convert JavaScript script to C# PLEASE HELP

Discussion in 'Documentation' started by Deleted User, Feb 25, 2017.

  1. Deleted User

    Deleted User

    Guest

    I have a script written in JavaScript and i want to convert it to c# but i don't have the skills to do it i have tried and online tool but it didn't work. I paste the online tool URL and my script. http://www.m2h.nl/files/js_to_c.php

    Thank you in advance.

    My script that i want to convert to c#.

    Code (JavaScript):
    1.  import System.IO;
    2.  
    3. private var latestVersionString = "randomText";
    4. var thisVersionFloat : float = 1.0;
    5. var dropBoxLatestVersionTXT = "https://www.dropbox.com/s/???????????????/version.txt?dl=1";
    6. function Start () {
    7.  
    8.    var www : WWW = new WWW(dropBoxLatestVersionTXT);
    9.    yield www;
    10.      latestVersionString = www.text;
    11.    
    12.     var latestVersionFloat : float = 3.14159265358979f;
    13.    
    14.     latestVersionFloat = float.Parse(latestVersionString);
    15.  
    16.     if(latestVersionFloat==thisVersionFloat) Debug.Log("You have the latest version of the game");
    17.     if(latestVersionFloat>thisVersionFloat) Debug.Log("You have outdated version of the game");
    18.  
    19. }
     
  2. BigBrotherParties

    BigBrotherParties

    Joined:
    Feb 22, 2017
    Posts:
    13
    Why you want to convert it ?
     
  3. Deleted User

    Deleted User

    Guest

    because i don't know javascript and i want to do some other stuff when the version is outdated. Can you please help me out.
     
  4. Deleted User

    Deleted User

    Guest

    I have tried this tool myself but it didin't work thats why i asked help from the forums.
    But if you can fix this script and make it work you will help me a lot
     
  5. BigBrotherParties

    BigBrotherParties

    Joined:
    Feb 22, 2017
    Posts:
    13