Scene Manager

What is Scene Manager?

Scene Manager is a scripting bundle which greatly helps in developing any level-based game. It is available on the Unity Asset Store. With Scene Manager, you can spend your time on being creative in making the next big hit Indie game, while Scene Manager works out the boring parts like plumbing the scene flow, keeping track of the user’s progress, load and save games or manage a full and demo version of your game.

Features

  • Easy and intuitive creation of scene flows - set up the order of your screens and levels with a few mouseclicks.
  • Keep track of the user’s progress inside your game. Common operations like “Start a new game”, “Continue playing”, “Go to next level” or “Select a level” are easily implementable with just a single line of code. If you are a visual developer you can use Scene Manager’s playMaker™ integration package to do all these operations with a playMaker™ action.
  • Customizable transitions between the levels. Everything from simple fade-out fade-in to a loading screen with tips tricks is possible*.
  • Level progress can be saved to and loaded from Unity Player Preferences with a one-liner or your very own savegame storage with a few lines more.
  • Multiple scene configurations are possible, which makes it easy to create a demo version of your game within the same project as your full version.
  • Scene Manager is well integrated with Unity’s Build system. A single click will synchronize the scene configuration with Unity’s build settings, so you are always sure that nothing is missing in your build.
  • Easy to use, extensible and well-documented API.
  • Comes with the source code so you can easily extend and modify the code base according to your needs.

Quick Links

Showcase

  • Check out the demo at http://www.ancientlightstudios.com/scenemanager/demo.This demo shows the basic functionality of Scene Manager in a simple game with a loading screen, main menu and four levels. You can see Scene Manager loading Levels, switching between levels, keeping track of the player’s progress, etc. The code behind almost every button is a one-liner. The demo is intended as a tech demo, so no fancy graphics there. You can however try out the transitions from the video below.
  • Check out our transitions video:

Documentation and tutorials

Latest Updates

Scene Manager 1.4.8 adds compatibility with Unity 4.5 and the latest version of playMaker.
Scene Manager 1.4.6 featuring better mobile integration.
Scene Manager 1.4.5 featuring Unity 4.3 support and several bugfixes.
Scene Manager 1.4 featuring Unity 4.x support, level groups and an improved inspector UI is available in the Unity asset store.
Scene Manager 1.3 is now available at the asset store. This version contains the playMaker™ integration package which allows you to use Scene Manager together with playMaker™.

You can find the full change log at our website.

  • playMaker™ users can use the bundled transitions out of the box, but custom transitions require scripting.

The built-in transitions use GUI.DrawTexture no fancy shaders etc, so they should work on mobile devices. Since GUI.DrawTexture is not optimal for performance reasons on mobile devices you might want to use a GUITexture instead. Modifying SMFadeTransition to use a GUITexture instead of GUI.DrawTexture is rather trivial.

Replace:

        void Start() {
		backgroundTexture = (Texture) Resources.Load("SMBlackTexture");
	}
	
	public void OnGUI() {
		if (inTransition) {
			GUI.depth = 0;
			Color c = GUI.color;
			GUI.color = new Color(c.r,c.g, c.b, progress);
			GUI.DrawTexture(new Rect(0,0, Screen.width, Screen.height), backgroundTexture);
			GUI.color = c;
		}
	}

With:

	void Start() {
		backgroundTexture = (Texture) Resources.Load("SMBlackTexture");
		guiTexture = gameObject.AddComponent<GUITexture>();
		guiTexture.texture = backgroundTexture;
		guiTexture.pixelInset = new Rect(0,0, Screen.width, Screen.height);
		transform.localScale = new Vector3(0,0,0); 
	}
	
	public void Update() {
		if (inTransition) {
			guiTexture.color =  new Color(0,0, 0, progress);;
		}
	}

Then again, for a level transition performance might not even be an issue, so the bundled transition might even be good enough. In the end you are totally free on what you do as a level transition as you are not limited to the bundled transitions. It can be a fade, a particle explosion, a progress bar, an advertisement screen, a waving rabbit, you name it. You just extend from SMTransition and do whatever you want to do in the DoTransition function. The bundled transitions are just a few demos that show how to properly implement a transition. Hope that helps. Feel free to ask if you need further information.

Very cool. Can this handle a master load scene for startup (An empty/simple scene at load that then loads a main menu scene)? Will you be posting a video demo? My first question may be moot.

Yes, we are working on a video demo to show some/all of the features of this package.
There is also a demo within the bundle already.

If you want to start you game with a different scene, just set it as “First Screen” within the
configuration inspector. Now it will be started by unity instead of the previous scene. You can
read more about that here.
The image shows the inspector with just the main menu set as a screen. But there can be more
than one screen in each configuration.

Scene Manager 1.2 is coming up and we’ve got a demo video of the new transitions. Check the first post for updates!

We’ve put a demo of Scene Manager 1.2 online. Check the first post for updates!

Scene Manager 1.2 is now live at the Asset store. Check first post for details.

Can I design you guys a new website for one copy of scene manager? :slight_smile:

I have a question,all your levels in your demo is pre-built and small,how about reading a big size level?how to deal with the delay time?
and when i want to read a level form a external .unity3d level file,do all the effects work smooth too?Should give more details/demo on this!

Hi,

Looks interesting.
I have a few questions though:

1. I opened your demo > click “GoTo Main Menu > click “New Game” : instead loading the Level 1 with a faded transition like you expect itll do, it is rendering for 1-1.5 seconds a menu youve never been before: “New Game”, “Continue Playing Level1” and"Reset Progress”. All this before loading/playing Level 1. And its a plain/abrupt transition, not a faded one, as you would expect according to the demo settings and to the previous behaviour. My question: Its a Scene Manager bug? Or a design issue?

  1. Do you have to be a programmer or have to know scripting to use it?

  2. If the answer to the second question is yes, do you plan a Playmaker integration? Playmaker actions for guys like me, who are not able to script/code.

Thanks in advance for your answers.

@kmgilbert you have a PM.

@liverol: It depends on your definition of a “big level”. In the demo video we used two slightly modified copies of the unity bootcamp demo level, which is quite complex and even there the loading times were below 1sec on my 4 year old laptop. So to really have some substantial loading time you probably have to put quite a lot of stuff into the level. Nevertheless, the size of the level has no direct influence on the animations.

All effects work in three stages: Out , Hold and In. In the out stage the Out animation is being played (e.g fade the level to black or flip all the tiles). Then the stage switches to Hold and the level is being loaded. The game object that is doing the transition will display some intermediary texture while doing this, but in the end there is still an Update function being called by Unity so you can do whatever you like in the hold stage (e…g show some level specific GUI, a progress bar or whatever). When the level is loaded, the transition goes into the In state and plays the In animation (e.g. fade the new level in or flip back all the tiles).

The bundled transitions will work out of the box and are configurable (see http://confluence.insomnia-hq.de/display/SCEMA/Reference#Reference-Appendix-Bundledtransitions) but of course we cannot foresee any usage scenario and especially level loading is somewhat application specific. E.g. you might want to load levels with LoadLevelAdditive or LoadLevelAsync instead of LoadLevel which is used by default. That is why Scene Manager is shipped with the full source code so you can modify anything to suit your specific needs instead of being stuck with an unmodifiable DLL.

We’re working on a tutorial video to show how to build a project with Scene Manager so that hopefully will also clear up a few questions. Let me know if you need further information :).

@Mark_T

  1. The new menu items are being shown because when you switch the level the internal state of Scene Manager will change as you are visiting the first level now. The demo just has a simplified GUI which dumbly renders out the state as it changes. In a real game, you will suspend GUI changes when an item is clicked. I’ll fix the GUI in the demo. About the missing fade animation, I’m a bit clueless here. Do the other transitions work for you? What Platform are you running this on?

  2. You won’t be able to use it without scripting. Then again, if you use the GameEnvironment script from the demo, then it actually boils down to a one liner per use case:

// Start a new game from the first level
GameEnvironment.SceneManager.LoadFirstLevel();
  
// Continue from the last played level
GameEnvironment.SceneManager.LoadLastPlayedLevel();
  
// Load the next level (the level after the one that is currently being played).
GameEnvironment.SceneManager.LoadNextLevel();
  1. As Playmaker is currently on sale, I shot myself a copy and I’ll see what can be done. From their tutorial video it should be easy to fire the above 3 lines from your own script with Playmaker (see http://www.youtube.com/watch?v=QVG-336_PsM&feature=related).

Thanks for your answer Kork.

Regarding my questions:

  1. Ill take it as a poor menu design issue. It doesnt have anything to do with my platform. Try yourself. After you click on Reset Progress will go into the 2 options (New Game, and Reset Progress). The very moment you press NewGame, will display very fast the 3 options menu (New Game, Continue Playing Level1 and Reset Progress) again, and after that, will fade slowly to level 1. Considering the demo is a marketing tool, it will be better to be a flawless one. For users like me, is harder to figure out if it`s a menu design error, or a Scene Manager issue.

  2. I understand. But telling me, a nonprogrammer, that I need only three line of code doesnt help. Because even if Ill make it work, Ill not be confident on my work. I have to be sure what Im doing, before I use it.

  3. Yep, thats the advantage of being a programmer. You can make it do what ever you want, extend Playmakers power and benefit from Playmakers speed of developing. But again, this is not my case. Im that dumb guy who doesnt know how to scrip/write code. :slight_smile:
    When I asked about Playmakers integration I was thinking about a complete set of actions I can use in Playmaker to use Scene Manager with almost the same freedom a programmer can do. I really enjoyed your answer to liverol. It showed me how Scene Manager is working and what is happening under the hood. If you ask me, I would like to have actions to give me the freedom, during the hold stage, to load my own custom sprite animations, or display a famous quote, or use some nGUI elements, or use some Playmaker structure which will do something to keep the player busy while the next level is loaded.
    Regarding writing Playmaker actions you can find more info here. And on the Playmakers forum, of course.
    Lucky me, Im not the only one who doesnt know to write code. :slight_smile: I think youll find a few interested customers like me that can not script, but can do their thing with Playmaker. If you can provide such actions, Ill be more than happy to be your customer.

One last thing. My target is mobile platforms. Are any restrictions regardind Android and iPhone (iOS)?

Thanks again and keep up the good work.

@Mark_T

Thanks so much for your feedback.

  1. The menu rendering issue is fixed, I’ll upload an update of the demo tonight. There is also a new Version 1.2.1 under test which includes some enhancements for easier work with GUIs.
  2. I see you point. For a non-programmer 3 lines of code are as much an obstacle as 1000 lines are.
  3. I have not yet had the time to look deeper into Playmaker, but integrating Scene Manager with it seems to be doable. Since that would introduce a dependency to Playmaker we would probably release this integration as a separate package. I’ll post updates about our progress with this here as soon as I find the time to work on it :slight_smile:
  4. We are currently not aware of restrictions with mobile platforms. Under the hood, Scene Manager does not use any functionality that is unavailable on mobile platforms. If you decide to do custom transitions, you will of course have to make sure their effects work on a mobile platform.

We have made a tutorial video available. Check the first post for details.

There is a new tutorial video available showing how to create a stripped-down demo version of your game with Scene Manager. Check the first post for details.

Hey, Im looking into this but one thing that keeps me on the edge. Can I customize the transition, like use my own shapes etc.?

@jrricky: The bundled transitions are examples of what you can do, but you are not limited to them. Every bundled transition has a few modifiable parameters which allow you to customize the transition without having to edit the source code. If you need something that cannot be set up by the transition parameters, you still have the source code of all transitions and shaders, so you can modify the transitions to suit your needs or even create a completely new transition.

I’m currently working on a tutorial video showing how to create and modify transitions, but this is going to take a few more days.