PPaste!

Heritage bjre

Home - All the pastes - Authored by Thooms

Raw version

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//----- 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");
    }
}