unity right click on gameobject

Code Example - unity right click on gameobject

                
                        private void OnMouseOver()
    {
        if(Input.GetMouseButtonDown(1))
        {
            Debug.Log("The gameObject has been right clicked");
        }
    }