I need advice on how to make a right click system similar to runescapes?

I am not asking for any code.

What I’m looking for is advice on how to do a right clicking system like runescapes. The only ways I can think of how to do this, is make a script for every clickable object in the game, but that would be a HUGE waste of space. Obviously this is not how I should do it.

The thing is, when you right click nothing / the ground, it should say nothing and only with a close button, but when you right click lets say a store keeper, there should be options like Talk, Store, Quest, Close. How can I make a system that detects what options the clicked object has, then puts it into an array? If any expert at Unity code could explain how this could be achieved, I would be incredibly grateful. Such a small thing is just being a huge problem for me to solve without wasting space. Thank you!

public class Clickable : MonoBehaviour {

  public virtual string[] Options { get { return new string[0]; } }
  public virtual void HandleClick() {

public class Shopkeeper : Clickable {
  public override string[] Options { get { return base.options.Concatenate(new string[]{"Sell","Buy"}; } }
  public override void HandleClick() {


public class PlayerInput : MonoBehaviour {
  void Update() {
    if ( Input.GetKeyDown(KeyCode.Mouse1) ) {
      RaycastHit rch = new RaycastHit();
      if ( Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition, out rch) ) { // this line is wrong, needs more arguments 
or something
         Clickable c = rch.collider.GetComponent<Clickable>();
         if ( c ) c.HandleClick();
         else HandleUnclickable();

Keyword: Inheritance.