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
1
Question by ssamoil · May 03, 2017 at 11:40 AM · scripting problemassetslauncherexternal-application

Launching multiple Unity games from a single "launcher" game

I have been looking into ways to launch existing Unity projects from a unified "launcher" Unity project and have run into a road block. My scenario is that I have 8 existing Unity projects that I would like to be able to launch from a single project using an interface somewhat like Steam Big Picture mode. The goal of this unified launcher is to have a nice clean interface that can be used when showing in person demos instead of going into the file system and launching each game individually.

From what I have found there are two main ways that this is possible:

  • merging all of the projects into a single project and building from there

  • using the -parentHWND command line argument with something like Process.Start() from the standard C# libraries

The first option is something I would like to avoid as it means having a single huge project that becomes hard to manage and maintain. The second option doesn't seem optimal as it means having to wait for Unity and everything else to load again.

Ideally I would like to do something similar to using asset bundles except with the ability to include scripts across projects in addition to the assets but as far as I can tell that isn't possible.

Is there a way to load other Unity games across projects from a single "launcher" style application without having to merge all of the projects together or have multiple instances of Unity running at the same time?

Comment
Add comment · Show 1
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 JohnCraigFreeman · Jun 06, 2017 at 07:23 PM 0
Share

@ssamoil, Did you solve this? I am trying to do something similar.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by JohnCraigFreeman · Jun 10, 2017 at 07:48 AM

@ssamoil, Did you solve this? I am trying to do something similar.

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 ssamoil · Jun 12, 2017 at 03:01 PM 0
Share

Unfortunately I didn't find a reasonable solution. From all the searching I did it looks like this isn't possible. I ended up just doing a basic non-Unity launcher that manages all of our applications in a way similar to the S$$anonymous$$m library.

avatar image JohnCraigFreeman ssamoil · Jun 12, 2017 at 03:28 PM 0
Share

Thanks ssamoil, This seems like such a basic functionality. How would we get someone from Unity to reply? I asked the following question in the 'Questions' forum:

Launch another Unity game C# script I am trying to write a C# script which will launch another Unity game when the character collides with a trigger. Can anyone provide and example?

avatar image ssamoil JohnCraigFreeman · Jun 13, 2017 at 03:21 PM 0
Share

I'm not sure how to get a hold of someone directly. I suppose this issue is basically why there are scenes but that doesn't solve the issue of avoiding an extremely cluttered project when the number of merged projects becomes unmanageable.

If there isn't an issue with the Unity splash screen showing in your case you could always just use the Process.Start() function but that looks and feels really hacky and far from ideal.

Show more comments
avatar image
0

Answer by tmarshall619 · Jun 13, 2017 at 03:32 PM

@ssamoil This isn't really optimum but if the games that you are trying to launch are your own ( or you have access to the source code) then you could make a build that compiles them all into a sort of super game where the "hub" is a scene with options to load the initial scenes of each of the games. Like I said, not optimal, but maybe a short term work around.

Comment
Add comment · Show 8 · 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 JohnCraigFreeman · Jun 13, 2017 at 03:37 PM 0
Share

I've tried this without success. They are all my games. They are just so big, they won't build in one if I try to do it all at once. So I want to be able to move from game to game. Here is what I have.

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using System.Diagnostics;
 
 public class Launch_Virtual_Wuhan_01_Script : $$anonymous$$onoBehaviour {
 
     void OnTriggerEnter(Collider other) {
         System.Diagnostics.Process.Start("Virtual_Wuhan_01.exe");
     }
 }
avatar image tmarshall619 JohnCraigFreeman · Jun 13, 2017 at 03:44 PM 0
Share

That looks about right to me. What happens when this code executes? The one exception I can think of is it might not know where to find the .exe. The examples that I found deal with applications that are probably in the the default install directories for windows. You might research how to direct that function call to a particular director so that it can find the executable. The best place to keep that would probably be in your Hub's build-data folder.

avatar image tmarshall619 tmarshall619 · Jun 13, 2017 at 03:45 PM 0
Share

Something like this http://answers.unity3d.com/questions/16675/running-an-external-exe-file-from-unity.html

Show more comments
avatar image tmarshall619 JohnCraigFreeman · Jun 13, 2017 at 03:52 PM 0
Share

https://docs.unity3d.com/ScriptReference/Application-dataPath.html @JohnCraigFreeman That returns the path that Unity starts looking in, which should be the corresponding data folder in the build folder for the project. If you organize your other games inside of the data folder you should be able to navigate to them using something like Application.datapath+"\yourSubDirectory\OrExecutableHere"

avatar image JohnCraigFreeman tmarshall619 · Jun 13, 2017 at 04:04 PM 0
Share

Oh! Of course. Awesome, I'll try that. Thanks

avatar image ssamoil · Jun 13, 2017 at 03:58 PM 0
Share

Hi tmarshall619, thank you for the response. Unfortunately I had tried something along the lines of what is being discussed in the comments (Process.Start()) and it still results in a new Unity instance being started up (with the whole splash screen and everything). The other issue I have run into is that since I am working on a VR application it means that context switching between processes isn't supported (both the Rift and the Vive do not allow it, they require all VR applications be shut down before starting a new one).

I had hoped to avoid doing a "super game" as you say because it results in a massive project and merging the existing projects could be a bit of an nightmare with conflicts in filenames, class names, etc.

avatar image tmarshall619 ssamoil · Jun 13, 2017 at 06:34 PM 0
Share

I agree, that would be pretty troublesome. VR in particular does complicate things. Honestly, I don't know how many options are out there if you are trying to avoid the splash screens and the issues associated with loading a new application in VR. That would be a lot of pretty complex ground up work.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

2D TileZone (not lite) 0 Answers

I can't Kill or Close the external exe that i already opened from the unity exe ? 0 Answers

Updating Unity stuff is overwriting scripts I've previously edited? 1 Answer

Unity Editor not finding assets after updating to macOS 10.13? 10 Answers

Why my Assets not loaded twice from the asset Bundle? 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