1
This commit is contained in:
@@ -16,15 +16,19 @@ namespace Net.Like.Xue.Tokyo
|
||||
{
|
||||
if (!lumina.sun)
|
||||
{
|
||||
foreach (var rootGameObject in SceneManager.GetActiveScene().GetRootGameObjects())
|
||||
for (var i = 0; i < SceneManager.sceneCount; i++)
|
||||
{
|
||||
if(rootGameObject.TryGetComponent<Light>(out var rootLight) is false)continue;
|
||||
if(rootLight.type is not LightType.Directional)continue;
|
||||
var scene = SceneManager.GetSceneAt(i);
|
||||
|
||||
foreach (var rootGameObject in scene.GetRootGameObjects())
|
||||
{
|
||||
if(rootGameObject.TryGetComponent<Light>(out var rootLight) is false)continue;
|
||||
if(rootLight.type is not LightType.Directional)continue;
|
||||
|
||||
lumina.sun = rootLight;
|
||||
return;
|
||||
lumina.sun = rootLight;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user