puzzle module framework, puzzle a ball module

This commit is contained in:
2022-11-18 02:10:05 +01:00
parent bd0934636f
commit 99e0452379
90 changed files with 4799 additions and 51 deletions

View File

@@ -0,0 +1,48 @@
using UnityEngine;
namespace Escape_Room_Engine.Desert.Scripts
{
public class EmissionToggle : MonoBehaviour
{
internal bool active;
private bool _previousActive;
private Material _material;
private void Awake()
{
_material = GetComponent<Renderer>().material;
}
private void Start()
{
Changed();
}
private void Update()
{
if (_previousActive != active)
{
Changed();
_previousActive = active;
}
}
private void Changed()
{
if (active)
{
_material.EnableKeyword("_EMISSION");
}
else
{
_material.DisableKeyword("_EMISSION");
}
}
public void SetActive(bool to)
{
this.active = to;
}
}
}