Load an exe file and set a variable from web page

Web Technologies Web Development 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating
_x000D_ _x000D_ I have recently been making a game in Unity (C#) and at the start a variable is set to a number. The number is a seed which is used to generate a 2d world out of blocks. This means that if the number is 5 then it will generate the same world for everyone using the seed 5. I would like to upload seeds to my webpage so when a user clicks a button, the compiled unity application (.EXE) opens and the "seed" variable is set to a certain number depending on which button is pressed. For instance I could make a button which loads the program with the seed variable set to '5', or I could load it with the seed variable set to number '8'. I am wondering if this is possible due to the file being complied and if so how would I do it? I have the code to load a .EXE file here: Click me Sorry if I am a bit too specific or confusing, this is my first post.

Posted on 16 Aug 2022, this text provides information on Web Development related to Web Technologies. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago
_x000D_ fortunately it's incredibly easy to load a text file from the internet, in Unity. void Start() { Debug.Log("i will now get the file at http://url.com/temp/hello.txt"); StartCoroutine(ReadFile()); } private IEnumerator ReadFile() { WWW w = new WWW("http://url.com/temp/hello.txt"); yield return w; if (w.error != null) { .. error yield break; } else { string result = w.text; Debug.Log("the web page is: result); } }

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Important Web Technologies Links