Skip to content

A small example on how to set up an automatic entry point in Unity, without the need for existing logic components in scenes.

Notifications You must be signed in to change notification settings

trond/UnityEntryPoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Unity Entry Point

A common way to put logic into Unity games, is to attach a script to an otherwise empty gameobject in order to get an entry point. Sometimes, you might want some code to run at the start of the game, regardless of initial scene or scene contents.

This is a small example on a possible way to solve that using Unity's PostProcessScene attribute to set up a traditional entry point. It also highlights some gotchas with the PostProcessScene functionality:

  • In builds, PostProcessScene has run on all scenes in the game
  • In the editor, PostProcessScene runs on only the currently loaded scene when you hit "Play". Trying to reload the current scene in the editor, will give you the un-postprocessed version.

About

A small example on how to set up an automatic entry point in Unity, without the need for existing logic components in scenes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages