37 lines
791 B
C#
37 lines
791 B
C#
using EscapeRoomEngine.Engine.Runtime.Utilities;
|
|
using NaughtyAttributes;
|
|
using UnityEngine;
|
|
|
|
namespace EscapeRoomEngine.Desert.Runtime
|
|
{
|
|
[RequireComponent(typeof(Emission))]
|
|
public class Crystal : MonoBehaviour
|
|
{
|
|
[Required] public Light crystalLight;
|
|
|
|
public bool Active
|
|
{
|
|
set
|
|
{
|
|
_emission.active = value;
|
|
crystalLight.enabled = value;
|
|
}
|
|
}
|
|
|
|
public DynamicColor Color
|
|
{
|
|
set
|
|
{
|
|
_emission.color = value.hdr;
|
|
crystalLight.color = value.ldr;
|
|
}
|
|
}
|
|
|
|
private Emission _emission;
|
|
|
|
private void Awake()
|
|
{
|
|
_emission = GetComponent<Emission>();
|
|
}
|
|
}
|
|
} |