summaryrefslogtreecommitdiff
path: root/Assets/MaterializeFX/MaterializationFX/Scripts/Utils/DemoInputConrtoller.cs
blob: c2b02251cccc2de1f4289bd28b26a4b3780404b9 (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 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;
        }
    }
}