Skip to content

Commit d3144cf

Browse files
Added check for project exceeding one controller
1 parent ced5e16 commit d3144cf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Runtime/Controller.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public abstract class Controller : UnityEngine.MonoBehaviour, IController {
2121

2222
/// During the awake, this system will start the initialization.
2323
private void Awake () {
24+
if (Controller.Instance != null)
25+
throw new System.Exception ("A project cannot exceed the limit of one controller!");
2426
UnityEngine.Object.DontDestroyOnLoad (this.transform.root.gameObject);
2527
Controller.Instance = this;
2628
this.systems = new System.Collections.Generic.List<IEntitySystem> ();

0 commit comments

Comments
 (0)