//----- SelectionRadial.cs
// And finally, in the same time, we run the code attached to the selectable.
m_VREyeRaycaster.CurrentInteractible.Click();
//----- VREyeRaycaster.cs
public void Click()
{
if (OnClick != null)
OnClick();
GetComponent<TriggerAction>().Action();
}
//----- TriggerAction.cs
[RequireComponent(typeof(VRStandardAssets.Utils.VRInteractiveItem))]
abstract public class TriggerAction : MonoBehaviour{
/// <summary>
/// You must implement this method on a custom script that you'll attach to the GameObject
/// </summary>
public abstract void Action();
}
//----- PlaceTheRightNameTrigger.cs
public class PlaceTheRightNameTrigger : TriggerAction {
public override void Action()
{
Debug.Log("You have selected the object " + gameObject.name + "! Have a great time outthere in the other world");
}
}