Pass Enum To Function Parameter

Hello,

On one script I have a enum variable, and I want to send the enum in a SendMessage as a parameter to another script, like so:

Weapon Object

// ----- Weapon Pickup ----- \\
enum selectWeapon {Gun, LargeGun}
var typeOfPickup : selectWeapon;

function OnCollisionEnter(hit : Collision){
   hit.collider.SendMessageUpwards("changeWeapon", typeOfPickup, SendMessageOptions.DontRequireReceiver);
}

And on my player

// ----- Player / Receiver ----- \\
function changeWeapon(weapon : ???) {
   if(currentWeapon == weapon.Gun){
      //do something
    }

}

Any ideas how I can do this?

Thanks

I tried to make a parameter of type _try(enum) and also int both worked for me. the below is the code. casting it to int would definitely work. Also i remember enum not working properly for if loops on another sciprts (in unity script), so used to follow casting to int method.

  public class enumChecker : MonoBehaviour {
	
	_try obj=_try.blah;
	// Use this for initialization
	void Start () {
		haha ((int)obj);
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void haha(int  temp)
	{
		print((_try)temp);
	}
	
}


public enum _try
	
{
	lol,
	meh,
	blah,
	rofl,
	lmao
	
}

You should be able to use selectWeapon as the type, as far as I can see. Is that not working?