new-horizons/NewHorizons/Handlers/SystemCreationHandler.cs
JohnCorby 656ff16305 Revert "Reformat"
This reverts commit 7c0ba5597720f963432d8379a236e74f3508d077.
2022-05-22 18:41:34 -07:00

32 lines
946 B
C#

using NewHorizons.Builder.StarSystem;
using NewHorizons.Components;
using NewHorizons.Utility;
using UnityEngine;
using Object = UnityEngine.Object;
namespace NewHorizons.Handlers
{
public static class SystemCreationHandler
{
public static void LoadSystem(NewHorizonsSystem system)
{
var skybox = GameObject.Find("Skybox/Starfield");
if (system.Config.skybox?.destroyStarField ?? false)
{
Object.Destroy(skybox);
}
if (system.Config.skybox?.assetBundle != null && system.Config.skybox?.path != null)
{
SkyboxBuilder.Make(system.Config.skybox, system.Mod);
}
if (system.Config.enableTimeLoop)
{
var timeLoopController = new GameObject("TimeLoopController");
timeLoopController.AddComponent<TimeLoopController>();
}
}
}
}