Пример #1
0
        private void Start()
        {
            InputTt.ChangeReceiver(red);
            redToggle.isOn   = true;
            greenToggle.isOn = false;

            redToggle.onValueChanged.AddListener((n) => {
                if (n)
                {
                    InputTt.ChangeReceiver(red);
                    greenToggle.isOn = false;
                }
                else
                {
                    InputTt.ChangeReceiver(green);
                    greenToggle.isOn = true;
                }
            });
            greenToggle.onValueChanged.AddListener((n) => {
                if (n)
                {
                    redToggle.isOn = false;
                }
                else
                {
                    redToggle.isOn = true;
                }
            });
        }
Пример #2
0
        private void Update()
        {
            if (InputTt.Input(this).GetKeyDown(KeyCode.W))
            {
                transform.position += Vector3.up * speed;
            }

            if (InputTt.Input(this).GetKeyDown(KeyCode.A))
            {
                transform.position += Vector3.left * speed;
            }

            if (InputTt.Input(this).GetKeyDown(KeyCode.S))
            {
                transform.position += Vector3.down * speed;
            }

            if (InputTt.Input(this).GetKeyDown(KeyCode.D))
            {
                transform.position += Vector3.right * speed;
            }
        }