DynamicColor, Crystal prefab, Finish Puzzle B
This commit is contained in:
37
Assets/Desert/Runtime/Crystal.cs
Normal file
37
Assets/Desert/Runtime/Crystal.cs
Normal 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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user