Example #1
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            collisionSides = Edges.None;
            return;
        }

        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            collisionSides = collisionSides.AddFlag <Edges>(Edges.Above);
            return;
        }

        if (Input.GetKeyDown(KeyCode.DownArrow))
        {
            collisionSides = collisionSides.AddFlag <Edges>(Edges.Below);
            return;
        }
        if (Input.GetKeyDown(KeyCode.LeftArrow))
        {
            collisionSides = collisionSides | Edges.Left;
            return;
        }
    }