34 lines
899 B
C#
34 lines
899 B
C#
|
|
using XCEngine;
|
||
|
|
|
||
|
|
namespace Gameplay
|
||
|
|
{
|
||
|
|
public sealed class LightPropertyProbe : MonoBehaviour
|
||
|
|
{
|
||
|
|
public bool LightLookupSucceeded;
|
||
|
|
public float ObservedIntensity;
|
||
|
|
public float ObservedRange;
|
||
|
|
public float ObservedSpotAngle;
|
||
|
|
public bool ObservedCastsShadows;
|
||
|
|
|
||
|
|
public void Start()
|
||
|
|
{
|
||
|
|
LightLookupSucceeded = TryGetComponent(out Light light);
|
||
|
|
if (light == null)
|
||
|
|
{
|
||
|
|
LightLookupSucceeded = false;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
ObservedIntensity = light.intensity;
|
||
|
|
ObservedRange = light.range;
|
||
|
|
ObservedSpotAngle = light.spotAngle;
|
||
|
|
ObservedCastsShadows = light.castsShadows;
|
||
|
|
|
||
|
|
light.intensity = 2.5f;
|
||
|
|
light.range = 42.0f;
|
||
|
|
light.spotAngle = 55.0f;
|
||
|
|
light.castsShadows = true;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|