32 lines
822 B
C#
32 lines
822 B
C#
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using Artngame.LUMINA;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.SceneManagement;
|
||
|
|
||
|
namespace Net.Like.Xue.Tokyo
|
||
|
{
|
||
|
public class LuminaSetupController : MonoBehaviour
|
||
|
{
|
||
|
[SerializeField]
|
||
|
private LUMINA lumina;
|
||
|
|
||
|
private void FixedUpdate()
|
||
|
{
|
||
|
if (!lumina.sun)
|
||
|
{
|
||
|
foreach (var rootGameObject in SceneManager.GetActiveScene().GetRootGameObjects())
|
||
|
{
|
||
|
if(rootGameObject.TryGetComponent<Light>(out var rootLight) is false)continue;
|
||
|
if(rootLight.type is not LightType.Directional)continue;
|
||
|
|
||
|
lumina.sun = rootLight;
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|