コード例 #1
0
 protected override void Update()
 {
     //just make all buttons turn on light to prevent arguing about the best button
     if (Controller.GetPressDown(GripButton) ||
         Controller.GetPressDown(TouchpadButton) ||
         Controller.GetPressDown(TriggerButton))
     {
         Light.SetActive(!Light.activeInHierarchy);
     }
 }
コード例 #2
0
        protected override void Update()
        {
            base.Update();
            if (PlayerGunInterface != null)
            {
                if (Controller.GetPressDown(GripButton))
                {
                    //  PlayerGunInterface.ReloadGun();
                }

                if (Controller.GetPressDown(TriggerButton))
                {
                    PlayerGunInterface.Shoot();
                    SteamVR_Controller.Input((int)Controller.index).TriggerHapticPulse(HAPTIC_PULSE_DURATION);
                }
            }
        }