27 lines
606 B
C#
27 lines
606 B
C#
using UnityEngine;
|
|
|
|
[RequireComponent(typeof(Light))]
|
|
public class ThemeLightBinder : MonoBehaviour
|
|
{
|
|
public Preferences preferences;
|
|
public float themeTime = 0.25f;
|
|
private Light _light;
|
|
|
|
private void Start() {
|
|
_light = gameObject.GetComponent<Light>();
|
|
|
|
if (preferences == null) {
|
|
Debug.Log("Light Binder needs Preferences.");
|
|
gameObject.SetActive(false);
|
|
}
|
|
}
|
|
|
|
private void Update() {
|
|
_light.color = preferences.Theme().Evaluate(themeTime);
|
|
}
|
|
|
|
public string ToString() {
|
|
return "Theme Light Binder";
|
|
}
|
|
}
|