diff options
author | chai <chaifix@163.com> | 2020-10-22 23:30:02 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-10-22 23:30:02 +0800 |
commit | 917e9e0b320775634dc2e710f7deac74fd0822f0 (patch) | |
tree | 637f3cccc80e7738c8a077fa3ff59218b8b18ee8 /Assets/MaterializeFX/MaterializationFX/Scripts/Utils/DemoInputConrtoller.cs | |
parent | 8268e4e308bd110dfea4ad849a7ff74e66951349 (diff) |
* amplify shader editor
Diffstat (limited to 'Assets/MaterializeFX/MaterializationFX/Scripts/Utils/DemoInputConrtoller.cs')
-rw-r--r-- | Assets/MaterializeFX/MaterializationFX/Scripts/Utils/DemoInputConrtoller.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Assets/MaterializeFX/MaterializationFX/Scripts/Utils/DemoInputConrtoller.cs b/Assets/MaterializeFX/MaterializationFX/Scripts/Utils/DemoInputConrtoller.cs new file mode 100644 index 00000000..c2b02251 --- /dev/null +++ b/Assets/MaterializeFX/MaterializationFX/Scripts/Utils/DemoInputConrtoller.cs @@ -0,0 +1,37 @@ +using UnityEngine; + +namespace MaterializationFX.Scripts.Utils +{ + internal sealed class DemoInputConrtoller : MonoBehaviour + { + private const string SpaceButton = "space"; + private const string LightButton = "f"; + private DemoPrefabController _demoPrefabController; + + public Light Light; + + public void EnableLigh() + { + Light.enabled = true; + } + + public void DisableLight() + { + Light.enabled = false; + } + + private void Start() + { + _demoPrefabController = GetComponent<DemoPrefabController>(); + } + + private void Update() + { + if (Input.GetKeyDown(SpaceButton)) + _demoPrefabController.Next(); + + if (Input.GetKeyDown(LightButton)) + Light.enabled = !Light.enabled; + } + } +}
\ No newline at end of file |