Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
2
Question by Rush3fan · Dec 15, 2011 at 08:37 AM · gamelineparameterscommandexe

Is it possible to execute a Unity game using a command line?

I want a different program to execute my game with a command line that contains various parameters such as the level number. Is that possible with a Unity exe?

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
3
Best Answer

Answer by flamy · Dec 15, 2011 at 08:54 AM

It is possible to run unity with some predefined command lines for more info look at this page. if u are passing ur custom command lines like level u should be able to read them through the following function,

System.Environment.GetCommandLineArgs()

but i doubt if it will help u!!... What are u planning to do exatly?! if u want to start the game with the level progress (like saving game data and loading on startup), you can use a loading screen that loads the saved level number from last time using Playerprefs class. If it is for testing purpose have a menu in the loading screen(simple gui buttons) to skip to the level u want!!

Anyway i think it was helpful :)

Edit: I know it is old, but sorry! this cannot be done for custom arguments!

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 Rush3fan · Dec 16, 2011 at 12:02 AM 0
Share

I can't tell you exactly what I'm doing, but all I can say is that is great news. It was either going to be that, or a .txt file that contains the parameters.

Well, thank you. That was very helpful as I tried typing "CommandLine" in the script reference search and nothing came up.

avatar image flamy · Dec 16, 2011 at 04:12 AM 0
Share

oh if u r a c# user try searching in msdn first and then chk if it is compatible with mono(Unity) :D that is how i do always :D

This is the list of all c# functions and classes supported in unity!

avatar image Rush3fan · Dec 16, 2011 at 04:19 AM 0
Share

I try to put everything in javascript. I like C++, but C# is hard to learn and javascript seems to be more popular in Unity.

avatar image flamy · Dec 16, 2011 at 05:23 AM 1
Share

even is started with js and thought it would be enough for ever! but ya all depends on one's personal preference, no probs with using js (Except if u want to use native plugins!)

also the list i have given above is not restricted only to c# u can use them in js aslo, u have to use import ; to access it in ur code and use it the same way as c# users do!

avatar image Rush3fan · Dec 16, 2011 at 05:36 AM 0
Share

Ok, thanks flamy!

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Command line iOS builds taking ages due to PVRTC 0 Answers

Opening a EXE file from a Unity game 1 Answer

Particle system and line renderer doesn't work in Maximized Window 1 Answer

getting udp package info inside unity (GlovePIE) 0 Answers

I can`t open .exe file after building the game for Windows 64 bit 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