merge EmissionToggle and EmissionColor into one, deprecates RingLight
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Escape_Room_Engine.Desert.Scripts;
|
||||
using Escape_Room_Engine.Engine.Scripts.Modules;
|
||||
using NaughtyAttributes;
|
||||
using UnityEngine;
|
||||
@@ -10,7 +11,7 @@ namespace Escape_Room_Engine.Desert.Modules.Puzzle_A.Scripts
|
||||
{
|
||||
private static readonly int LightFlash = Animator.StringToHash("Light Flash");
|
||||
|
||||
[BoxGroup("Internal")] [Required] public RingLight ringLight;
|
||||
[BoxGroup("Internal")] [Required] public Emission ringLight;
|
||||
[BoxGroup("Internal")] [Required] public Ring ring;
|
||||
|
||||
private Animator _animator;
|
||||
@@ -32,11 +33,11 @@ namespace Escape_Room_Engine.Desert.Modules.Puzzle_A.Scripts
|
||||
break;
|
||||
case PuzzleEventType.Solved:
|
||||
ring.Solved = true;
|
||||
ringLight.Color = theme.solvedColor;
|
||||
ringLight.color = theme.solvedColor;
|
||||
TurnOnRingLight();
|
||||
break;
|
||||
case PuzzleEventType.WrongInput:
|
||||
ringLight.Color = theme.puzzleColor;
|
||||
ringLight.color = theme.puzzleColor;
|
||||
_animator.SetTrigger(LightFlash);
|
||||
break;
|
||||
default:
|
||||
@@ -47,12 +48,12 @@ namespace Escape_Room_Engine.Desert.Modules.Puzzle_A.Scripts
|
||||
|
||||
public void TurnOnRingLight()
|
||||
{
|
||||
ringLight.Active = true;
|
||||
ringLight.active = true;
|
||||
}
|
||||
|
||||
public void TurnOffRingLight()
|
||||
{
|
||||
ringLight.Active = false;
|
||||
ringLight.active = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using UnityEngine;
|
||||
|
||||
namespace Escape_Room_Engine.Desert.Modules.Puzzle_A.Scripts
|
||||
{
|
||||
[RequireComponent(typeof(EmissionToggle))]
|
||||
[RequireComponent(typeof(Emission))]
|
||||
public class Crystal : MonoBehaviour
|
||||
{
|
||||
[Required] public Light crystalLight;
|
||||
@@ -19,11 +19,11 @@ namespace Escape_Room_Engine.Desert.Modules.Puzzle_A.Scripts
|
||||
}
|
||||
}
|
||||
|
||||
private EmissionToggle _emission;
|
||||
private Emission _emission;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_emission = GetComponent<EmissionToggle>();
|
||||
_emission = GetComponent<Emission>();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
using Escape_Room_Engine.Desert.Scripts;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Escape_Room_Engine.Desert.Modules.Puzzle_A.Scripts
|
||||
{
|
||||
[RequireComponent(typeof(EmissionToggle), typeof(EmissionColor))]
|
||||
public class RingLight : MonoBehaviour
|
||||
{
|
||||
public bool Active
|
||||
{
|
||||
get => _emissionToggle.active;
|
||||
set
|
||||
{
|
||||
_emissionToggle.active = value;
|
||||
}
|
||||
}
|
||||
public Color Color
|
||||
{
|
||||
get => _emissionColor.color;
|
||||
set => _emissionColor.color = value;
|
||||
}
|
||||
|
||||
private EmissionToggle _emissionToggle;
|
||||
private EmissionColor _emissionColor;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_emissionToggle = GetComponent<EmissionToggle>();
|
||||
_emissionColor = GetComponent<EmissionColor>();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Active = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a8f20dfd8ae64b4d87b98590269b7298
|
||||
timeCreated: 1668704631
|
||||
@@ -3,7 +3,7 @@ using UnityEngine;
|
||||
|
||||
namespace Escape_Room_Engine.Desert.Modules.Puzzle_A.Scripts
|
||||
{
|
||||
[RequireComponent(typeof(EmissionToggle))]
|
||||
[RequireComponent(typeof(Emission))]
|
||||
public class Symbol : MonoBehaviour
|
||||
{
|
||||
public float anglePosition;
|
||||
@@ -17,11 +17,11 @@ namespace Escape_Room_Engine.Desert.Modules.Puzzle_A.Scripts
|
||||
}
|
||||
}
|
||||
|
||||
private EmissionToggle _emission;
|
||||
private Emission _emission;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_emission = GetComponent<EmissionToggle>();
|
||||
_emission = GetComponent<Emission>();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
|
||||
Reference in New Issue
Block a user