private void Start()
    {
        if (GetComponent<VRTK_ControllerEvents>() == null)
        {
            Debug.LogError("VRTK_ControllerEvents_ListenerExample is required to be attached to a SteamVR Controller that has the VRTK_ControllerEvents script attached to it");
            return;
        }

        events = GetComponent<VRTK_ControllerEvents>();
        actions = GetComponent<VRTK_ControllerActions>();
        tooltips = GetComponentInChildren<VRTK_ControllerTooltips>();

        //Setup controller event listeners
        events.TriggerPressed += new ControllerInteractionEventHandler(DoTriggerPressed);
        events.TriggerReleased += new ControllerInteractionEventHandler(DoTriggerReleased);

        events.ApplicationMenuPressed += new ControllerInteractionEventHandler(DoApplicationMenuPressed);
        events.ApplicationMenuReleased += new ControllerInteractionEventHandler(DoApplicationMenuReleased);

        events.GripPressed += new ControllerInteractionEventHandler(DoGripPressed);
        events.GripReleased += new ControllerInteractionEventHandler(DoGripReleased);

        events.TouchpadPressed += new ControllerInteractionEventHandler(DoTouchpadPressed);
        events.TouchpadReleased += new ControllerInteractionEventHandler(DoTouchpadReleased);

        tooltips.ShowTips(false);
    }
コード例 #2
0
 private void Start()
 {
     tooltip = GetComponent <VRTK.VRTK_ControllerTooltips>();
     StartCoroutine(RemoveTooltips());
 }