void ReadStemInput(bool argAllowExtra) { helpdebug hd = PRINTER; if (_CanStartLocatingTrackers) { SixenseCore.TrackerVisual tracker = null; foreach (var t in m_trackers) { if (t.HasInput) { tracker = t; break; } } if (tracker == null) { return; } var controller = tracker.Input; //var id = tracker.m_trackerBind; //if (controller.GetButtonDown(SixenseCore.Buttons.TRIGGER)) { // if (GameSettings.Instance.IsAllowVibrate) { controller.Vibrate(150, 1); } ItShootsGun(); //} //if (controller.GetButtonUp(SixenseCore.Buttons.TRIGGER)) { ItStopsShooting(); } if (isPlayerAllowedToUseStemInput) { ReadJoystickHorizontalInput(controller); ReadTriggetInput(controller); //disable laser from here instead of gun //if (controller.GetButtonUp(SixenseCore.Buttons.BUMPER)) { if (argAllowExtra) _curEquippedIGun.ToggleLazerOnOff(); } if (controller.GetButtonDown(Buttons.NEXT) || controller.GetButtonDown(Buttons.PREV) || controller.GetButtonDown(Buttons.A) || controller.GetButtonDown(Buttons.B) || controller.GetButtonDown(Buttons.X) || controller.GetButtonDown(Buttons.Y)) { Ejects_LoadedMag(); if (GameSettings.Instance.IsAllowVibrate) { controller.Vibrate(500, .5f); } } } } }
public bool RegisterTracker(TrackerVisual t) { foreach(var p in m_trackerPrefabs) { if(p.m_type == t.m_type) { m_sceneTrackers[t.m_trackerBind] = t; t.gameObject.layer = gameObject.layer; t.gameObject.GetComponentInChildren<Renderer>().gameObject.layer = gameObject.layer; return true; } } return false; }
public bool RegisterTracker(TrackerVisual t) { foreach (var p in m_trackerPrefabs) { if (p.m_type == t.m_type) { m_sceneTrackers[t.m_trackerBind] = t; t.gameObject.layer = gameObject.layer; t.gameObject.GetComponentInChildren <Renderer>().gameObject.layer = gameObject.layer; return(true); } } return(false); }
//Gun Effects flash Calls stemkitmngr Broadcast void Handle_Vibrate(int x, float zeroone) { if (GameSettings.Instance.IsAllowVibrate) { SixenseCore.TrackerVisual tracker = null; foreach (var t in m_trackers) { if (t.HasInput) { tracker = t; break; } } if (tracker == null) { return; } var controller = tracker.Input; controller.Vibrate(x, zeroone); } }
// Updates the animated object from controller input. void Update() { SixenseCore.TrackerVisual tracker = null; foreach (var t in m_trackers) { if (t.HasInput) { tracker = t; break; } } if (tracker == null) { return; } var controller = tracker.Input; var id = tracker.m_trackerBind; if (controller.GetAnyButtonDown()) { // tell stem system to align stem_aligner.Align(); } //Commented out to add custom implemtation - JP 1/5/17 //// Point // if (id == SixenseCore.TrackerID.CONTROLLER_RIGHT ? controller.GetButton(SixenseCore.Buttons.A) : controller.GetButton(SixenseCore.Buttons.X)) //{ // m_animator.SetBool( "Point", true ); //} //else //{ // m_animator.SetBool( "Point", false ); //} // // Grip Ball // if (id == SixenseCore.TrackerID.CONTROLLER_RIGHT ? controller.GetButton(SixenseCore.Buttons.X) : controller.GetButton(SixenseCore.Buttons.A)) // { // m_animator.SetBool( "GripBall", true ); // } // else // { // m_animator.SetBool( "GripBall", false ); // } // // Hold Book // if (id == SixenseCore.TrackerID.CONTROLLER_RIGHT ? controller.GetButton(SixenseCore.Buttons.B) : controller.GetButton(SixenseCore.Buttons.Y)) // { // m_animator.SetBool( "HoldBook", true ); // } // else // { // m_animator.SetBool( "HoldBook", false ); // } // // Fist // float fTriggerVal = controller.Trigger; // fTriggerVal = Mathf.Lerp( m_fLastTriggerVal, fTriggerVal, 0.1f ); // m_fLastTriggerVal = fTriggerVal; // if ( fTriggerVal > 0.01f ) // { // m_animator.SetBool( "Fist", true ); // } // else // { // m_animator.SetBool( "Fist", false ); // } // m_animator.SetFloat("FistAmount", fTriggerVal); // // Idle // if ( m_animator.GetBool("Fist") == false && // m_animator.GetBool("HoldBook") == false && // m_animator.GetBool("GripBall") == false && // m_animator.GetBool("Point") == false ) // { // m_animator.SetBool("Idle", true); // } // else // { // m_animator.SetBool("Idle", false); // } }
void Start() { Alpha_trackerVisual = TRACKED_TrackerAlpha.GetComponentInChildren <SixenseCore.TrackerVisual>(); Bravo_trackerVisual = TRACKED_TrackerBravo.GetComponentInChildren <SixenseCore.TrackerVisual>(); }