From 6b472e13745fe7ade7950f743604de08c1a1ddc1 Mon Sep 17 00:00:00 2001 From: in0finite Date: Sun, 23 Jan 2022 05:53:28 +0100 Subject: [PATCH] ... --- Assets/Scripts/Behaviours/Loader.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Assets/Scripts/Behaviours/Loader.cs b/Assets/Scripts/Behaviours/Loader.cs index e2e8e2fc..49dce127 100644 --- a/Assets/Scripts/Behaviours/Loader.cs +++ b/Assets/Scripts/Behaviours/Loader.cs @@ -110,15 +110,18 @@ namespace SanAndreasUnity.Behaviours } - if (Cell.Instance != null) { - // add steps for cell - AddLoadingStep( new LoadingStep( () => Cell.Instance.CreateStaticGeometry (), "Creating static geometry", 5.8f ) ); - AddLoadingStep( new LoadingStep( () => Cell.Instance.InitStaticGeometry (), "Init static geometry", 0.35f ) ); - AddLoadingStep( new LoadingStep( () => Cell.Instance.LoadParkedVehicles (), "Loading parked vehicles", 0.2f ) ); - AddLoadingStep( new LoadingStep( () => Cell.Instance.CreateEnexes (), "Creating enexes", 0.1f ) ); - AddLoadingStep( new LoadingStep( () => Cell.Instance.LoadWater (), "Loading water", 0.08f ) ); - AddLoadingStep( new LoadingStep( () => Cell.Instance.FinalizeLoad (), "Finalize world loading", 0.01f ) ); + var worldSteps = new LoadingStep[] + { + new LoadingStep( () => Cell.Instance.CreateStaticGeometry (), "Creating static geometry", 5.8f ), + new LoadingStep( () => Cell.Instance.InitStaticGeometry (), "Init static geometry", 0.35f ), + new LoadingStep( () => Cell.Instance.LoadParkedVehicles (), "Loading parked vehicles", 0.2f ), + new LoadingStep( () => Cell.Instance.CreateEnexes (), "Creating enexes", 0.1f ), + new LoadingStep( () => Cell.Instance.LoadWater (), "Loading water", 0.08f ), + new LoadingStep( () => Cell.Instance.FinalizeLoad (), "Finalize world loading", 0.01f ), + }; + if (Cell.Instance != null) { + worldSteps.ForEach(AddLoadingStep); } }