GearGuyCtrl1.Flip C# (CSharp) Method

Flip() private method

private Flip ( ) : void
return void
    private void Flip()
    {
        // Switch the way the player is labelled as facing.
        facingRight = !facingRight;

        // Multiply the player's x local scale by -1.
        Vector3 theScale = transform.localScale;
        theScale.x *= -1;
        transform.localScale = theScale;
    }