- Home /
Is it possible to link three separate applications together?
We have three separate applications for our game. Each application is a different act in our story, and we want them to transition from one to another, perhaps by a button or something. Is there anyway to do this so it's all in one application, and so we don't have to exit one application to start the next? Essentially, we are trying to combine three different projects (games) into one.
Our game has a story that is broken up into three acts. Each act was created as a different project, and uses the same assets. Now we want to combine all of the acts together into one game that doesn't require the user to exit the application and open another to start the next part of our story. Is there a way to accomplish this?
Out of the box, I don't think so.
How are you serving the game? If it's over something like WebGL, you could preserve state using either cookies between pages or local JS data and reloading the active unity frame.
If it's a conventional PC build... there's probably a cute way of accomplishing this using local networking and loading assets from other clients...
We are still early in the development phase, it hasn't been published. We are needing to link these projects together, however the assets in each act are the same. We're trying to combine each project and allow the player to transition between acts fluently. Our problem is scene errors.
I think you have your answer there. You did not think about the Unity "paradigm" when starting your different "acts", so of course you have errors when trying to combine them.
You're going to have to step back, think about how Unity handles things in "Scenes", how asset files need to be organized and then revise your 3 projects accordingly, fixing errors.
You should be able to seperate out Scenes and or have "assetbundles" and load the 3 acts from a single main app.
Answer by Legend_Bacon · Jan 10, 2019 at 06:00 PM
Hello there,
First, I have to recommend rethinking the way you're building your project. Unity has SCENES for the exact purpose you are describing, and separating your project into three different applications makes little sense here. Especially if they're using the same assets, since every application would have a different copy of the same asset.
If you are doing this in an effort to have people "download" other acts (like episodes in a story-based game for example), you should look into Asset Bundles instead.
Now if you are really determined to start external applications for each "act", you have lots of issues to consider.
Which platform(s) are you targeting? Starting external EXEs through code can vary widely depending on the platform. (Here is the code for Windows)
Do these applications need to share data with each other? For example, a crucial choice that the player has made. Where do you store the data so that the other "acts" have access to it?
Do the applications need to talk to each other directly? Hopefully this is not what you're doing, but if you are then you have to think about the way you would go about it. You could do a local TCP server, or have a common folder with predefined commands that applications read from.
If you are just trying to tie 3 different games together so that finishing #1 would start #2, then the easiest would be the first point in my list. However, you have to be careful with handling the Exes. Where do you put them so that they can be found? What if the user moves them elsewhere? Also, they would definitely be different applications: users will notice a window opening.
I hope that helps!
Cheers,
~LegendBacon
Answer by L42yB · Jan 10, 2019 at 06:10 PM
You can have a primary scene that is just for loading, and here you can cache any data that is shared between the sub-scenes.
Then additively load in each of the level scenes from here with a scene controller script. When you switch scenes, unload the current one and additively load in the next one.
(Set the LoadSceneMode parameter to Additive to load in a scene additively) https://docs.unity3d.com/ScriptReference/SceneManagement.LoadSceneMode.html
Answer by badadam · Jan 10, 2019 at 08:24 PM
Combine all assets and scenes of your three applications into one unity project. And then you can make them transition from one scene of an application to one scene of another application.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Can you set the state of the animator on enabled = true? 0 Answers
Add files to folder 1 Answer