5 protected SCR_NightModeGameModeComponent GetNightModeComponent()
7 BaseGameMode gameMode =
GetGame().GetGameMode();
11 return SCR_NightModeGameModeComponent.Cast(gameMode.FindComponent(SCR_NightModeGameModeComponent));
15 protected void OnEditorNightModeEnabled(
bool enabled)
21 SCR_NightModeGameModeComponent nightModeComponent = GetNightModeComponent();
22 if (!nightModeComponent)
26 if (!nightModeComponent.IsGlobalNightModeEnabled())
31 override protected void OnInitCondition(Managed owner)
33 SCR_NightModeGameModeComponent nightModeComponent = GetNightModeComponent();
34 if (!nightModeComponent)
37 nightModeComponent.GetOnLocalEditorNightModeEnabledChanged().Insert(OnEditorNightModeEnabled);
41 override protected void OnExitCondition(Managed owner)
43 SCR_NightModeGameModeComponent nightModeComponent = GetNightModeComponent();
44 if (!nightModeComponent)
47 nightModeComponent.GetOnLocalEditorNightModeEnabledChanged().Insert(OnEditorNightModeEnabled);