summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/MaterializeFX/Scripts/Utils/DemoInputConrtoller.cs
blob: f5b2c26f2623771ed08307fe351f83bb800e14d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using UnityEngine;

namespace Assets.MaterializeFX.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;
        }
    }
}