KeyInput.Update C# (CSharp) Method

Update() private method

private Update ( ) : void
return void
    void Update()
    {
        //UpArrow
        if (Input.GetKeyUp(KeyCode.UpArrow))
        {
            cellHandler.Swipe(Direction.UP);
        }

        //DownArrow
        if (Input.GetKeyUp(KeyCode.DownArrow))
        {
            cellHandler.Swipe(Direction.DOWN);
        }

        //LeftArrow
        if (Input.GetKeyUp(KeyCode.LeftArrow))
        {
            cellHandler.Swipe(Direction.LEFT);
        }

        //RightArrow
        if (Input.GetKeyUp(KeyCode.RightArrow))
        {
            cellHandler.Swipe(Direction.RIGHT);
        }
    }

Usage Example

Example #1
0
    protected override void Update()
    {
        base.Update();

        _keyInput.Update(this);
        _directionInput.Update(Input.mousePosition, Camera.main.WorldToScreenPoint(Position), this);
    }
All Usage Examples Of KeyInput::Update