From 7d1690e2c8a94673b23622000969a3ffa6c53455 Mon Sep 17 00:00:00 2001 From: Jeffrey Lanters Date: Mon, 27 Mar 2023 11:04:30 +0200 Subject: [PATCH] Minor execution order improvements --- Runtime/EntityComponent.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Runtime/EntityComponent.cs b/Runtime/EntityComponent.cs index 6ee0b55..613d71b 100644 --- a/Runtime/EntityComponent.cs +++ b/Runtime/EntityComponent.cs @@ -78,11 +78,12 @@ public Vector3 localScale { /// The system. /// EntitySystemType GetSystem () { + if (system != null) { + return system; + } if (Controller.Instance == null) { throw new System.Exception ("Tried to access the Controller while non is instantiated"); } - if (system != null) - return system; if (Controller.Instance.HasSystem ()) { system = Controller.Instance.GetSystem (); return system;