/// <summary> Changes this script's Debug Mode </summary> /// <param name="mode"></param> public void SetDebugMode(PickupDebug mode) { this.debugMode = mode; if (debugMode != PickupDebug.ToggleOnTouch) { bool setOn = mode == PickupDebug.AlwaysOn ? true : false; SetAllVisuals(setOn); } else { this.UpdateTouch(); } }
// Called during a physics update. void FixedUpdate() { if (touch != null) { touch.isTrigger = true; } //enure the touch collider is always kinematic. if ((this.touchedObject != null && !this.touchedObject.activeInHierarchy) || (this.touchedScript != null && !this.touchedScript.isInteractable)) { //SenseGlove_Debugger.Log("Object no longer exists. Releasing."); this.SetDebug(false); this.touchedObject = null; this.touchedScript = null; } //check debug logic if (this.grabScript != null && this.grabScript is SenseGlove_PhysGrab) { if (((SenseGlove_PhysGrab)this.grabScript).debugMode != this.debugLvl) { this.debugLvl = ((SenseGlove_PhysGrab)this.grabScript).debugMode; if (this.debugLvl == PickupDebug.Off) { this.SetDebug(false); } else if (this.debugLvl == PickupDebug.AlwaysOn) { this.SetDebug(true); } else if (this.debugLvl == PickupDebug.ToggleOnTouch) { this.SetDebug(this.touchedObject != null); } } } }
/// <summary> Edit the Debug level of this SenseGlove_Touch </summary> /// <param name="debugLevel"></param> public void SetDebugLevel(PickupDebug debugLevel) { this.debugLvl = debugLevel; }