You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(Utilities): ability to change object state based on loaded sdk
The new SDK Object State script allows the state of a GameObject or
Component to be set to enabled/active or disabled based on the
SDK information.
This can be useful for toggling certain settings for different SDK
types, headsets or connected controllers.
@@ -7768,6 +7769,40 @@ The UpdateTransform method updates the Transform data on the current GameObject
7768
7769
7769
7770
---
7770
7771
7772
+
## SDK Object State (VRTK_SDKObjectState)
7773
+
7774
+
### Overview
7775
+
7776
+
The SDK Object State script can be used to set the enable/active state of a GameObject or Component based on SDK information.
7777
+
7778
+
The state can be determined by:
7779
+
* The current loaded SDK setup.
7780
+
* The current attached Headset type.
7781
+
* The current attached Controller type.
7782
+
7783
+
### Inspector Parameters
7784
+
7785
+
* **Target:** The GameObject or Component that is the target of the enable/disable action. If this is left blank then the GameObject that the script is attached to will be used as the `Target`.
7786
+
* **Object State:** The state to set the `Target` to when this script is enabled. Checking this box will enable/activate the `Target`, unchecking will disable/deactivate the `Target`.
7787
+
* **Loaded SDK Setup:** If the currently loaded SDK Setup matches the one provided here then the `Target` state will be set to the desired `Object State`.
7788
+
* **Headset Type:** If the attached headset type matches the selected headset then the `Target` state will be set to the desired `Object State`.
7789
+
* **Controller Type:** If the current controller type matches the selected controller type then the `Target` state will be set to the desired `Object State`.
[Tooltip("The GameObject or Component that is the target of the enable/disable action. If this is left blank then the GameObject that the script is attached to will be used as the `Target`.")]
23
+
publicObjecttarget=null;
24
+
[Tooltip("The state to set the `Target` to when this script is enabled. Checking this box will enable/activate the `Target`, unchecking will disable/deactivate the `Target`.")]
25
+
publicboolobjectState=false;
26
+
[Tooltip("If the currently loaded SDK Setup matches the one provided here then the `Target` state will be set to the desired `Object State`.")]
27
+
publicVRTK_SDKSetuploadedSDKSetup=null;
28
+
[Tooltip("If the attached headset type matches the selected headset then the `Target` state will be set to the desired `Object State`.")]
0 commit comments