GameObject touchable instead GUI button

i have this

if( GUI.Button( new Rect( xPos, yPos, width, height ), "Start Video Texture Two" ) )
		{
			// create the video texture
			_videoTextureTwo = new VideoTexture( "skyfall.m4v", 480, 264, false, 0, true );

}

i want to make instead a GUI button make a GameObject for example an cube touchable, and send this star video blab la. so. .
what do i can do for it?

please help im stock

You can add a Collider component to your GameObject. Then, to check for touch on the object, on the Update() function of your GameObject, do a RaycastHit test like below:

Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hitInfo;
if (collider.Raycast(ray, out hitInfo, 1.0e8f))
{
    if (!Physics.Raycast(ray, hitInfo.distance - 0.01f))
    {
	   // do your button handling here
    }
}

Hope this is helpful!

Check this

but this is not C++ isnt ?

sorry im new on this, this is the code C++ that i want to change :
i have to change all this to a touchable GameObject :

if( GUI.Button( new Rect( xPos, yPos, width, height ), “Start Video Texture Two” ) )
{
// create the video texture
_videoTextureTwo = new VideoTexture( “skyfall.m4v”, 640, 360, false, 0, true );

		// apply the texture to a material and set the UVs
        targetTwo.renderer.sharedMaterial.mainTexture = _videoTextureTwo.texture;
        LiveTextureBinding.updateMaterialUVScaleForTexture( targetTwo.renderer.sharedMaterial, _videoTextureTwo.texture );
		
		// add some event handlers
		_videoTextureTwo.videoDidStartEvent = () =>
		{
			Debug.Log( "Video two started" );
		};
		_videoTextureTwo.videoDidFinishEvent = () =>
		{
			// when the video finishes if we are not set to loop this instance is no longer valid and this texture is not set to loop
			_videoTextureTwo = null;
			Debug.Log( "Video two finished" );
		};
	}


Please heeeeeelp i so stock