Пример #1
0
        private void Update()
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                move.Jump();
            }

            if (Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.DownArrow))
            {
                move.Crounch();
                moviments.isCrounched = true;
            }
            else
            {
                moviments.isCrounched = false;
            }

            if (Input.GetKey(KeyCode.LeftShift))
            {
                if (!moviments.isCrounched)
                {
                    move.Run();
                }

                moviments.isRunning = true;
            }
            else
            {
                moviments.isRunning = false;
            }
        }