DynamicColor, Crystal prefab, Finish Puzzle B

This commit is contained in:
2022-11-28 23:31:00 +01:00
parent 60e390a993
commit 450c16c94f
63 changed files with 2915 additions and 361 deletions

View File

@@ -0,0 +1,37 @@
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>();
}
}
}