Exemplo n.º 1
0
    public void KeysInputAction()
    {
        if (_currentObjectToEdit == null)
        {
            return;
        }

        if (Input.GetKey(KeyCode.W))
        {
            _currentObjectToEdit.Translate(Vector3.forward);
        }
        else if (Input.GetKey(KeyCode.A))
        {
            _currentObjectToEdit.Translate(Vector3.left);
        }
        else if (Input.GetKey(KeyCode.S))
        {
            _currentObjectToEdit.Translate(Vector3.back);
        }
        else if (Input.GetKey(KeyCode.D))
        {
            _currentObjectToEdit.Translate(Vector3.right);
        }
        else if (Input.GetKey(KeyCode.LeftArrow))
        {
            _currentObjectToEdit.Rotate(5);
        }
        else if (Input.GetKey(KeyCode.RightArrow))
        {
            _currentObjectToEdit.Rotate(-5);
        }
        else if (Input.GetKey(KeyCode.Delete))
        {
            Destroy(_currentObjectToEdit.gameObject);
        }
        else if (Input.GetKey(KeyCode.KeypadEnter))
        {
            _currentObjectToEdit.nameToDisplay =
                GameController.Instance.UiController.EditorUiController.inputField.text;
        }
    }