8b757d7ed1
This is not a perfect fix because if the config p is opened on window side the vr side will broken |
||
---|---|---|
.. | ||
ButtonSettingManager.cs | ||
ButtonSettingManager.cs.meta | ||
CaptureSettingManager.cs | ||
CaptureSettingManager.cs.meta | ||
ComponentAutoName.cs | ||
ComponentAutoName.cs.meta | ||
Config.cs | ||
Config.cs.meta | ||
ConfigManager.cs | ||
ConfigManager.cs.meta | ||
ConfigPanelComponent.cs | ||
ConfigPanelComponent.cs.meta | ||
Configuration.asmdef | ||
Configuration.asmdef.meta | ||
EnviromentManager.cs | ||
EnviromentManager.cs.meta | ||
LocomotionStatus.cs | ||
LocomotionStatus.cs.meta | ||
LocomotionToggle.cs | ||
LocomotionToggle.cs.meta | ||
PanelHiderButton.cs | ||
PanelHiderButton.cs.meta | ||
PlayerSettingManager.cs | ||
PlayerSettingManager.cs.meta | ||
README.md | ||
README.md.meta | ||
SkyboxSwitcher.cs | ||
SkyboxSwitcher.cs.meta | ||
SpectatorManager.cs | ||
SpectatorManager.cs.meta | ||
StartBatchManager.cs | ||
StartBatchManager.cs.meta | ||
TouchSettingManager.cs | ||
TouchSettingManager.cs.meta | ||
ValueManager.cs | ||
ValueManager.cs.meta | ||
VisibilityManager.cs | ||
VisibilityManager.cs.meta |
How to add configuration widget
- First, you will find the widget prefab in the
/Asset/Prefab
folder. - Add any type of widget to the Config Canvans. Just follow other widgets' placement.
- You can also duplicate the existing widget.
- Rename the widget. This is very important because everything is based on the widget's name. You can have space in your widget's name but it will automatically be removed in the script. The space is for visual only since JSON does not support key names with space.
- Then you can use unity's
onvalueChanged
function in the inspector to control your function or make your own script. - For scrip, pls check the
CaptureSettingManager.cs
, you need to copy and paste the StartUp content and modify it with your need. - First use
var someWidget = ConfigManager.GetConfigPanelWidget("WidgetNameWithOutSpace");
to get Widget - Then use
var someDropdown = someWidget.GetComponent<TMP_Dropdown>();
to get the ui component. - Then you can use
someDropdown.onValueChanged.AddListener( (int value) => {var somethingYouWantToDoWith = value} );
to add something you want to execute when the config is updated. - Now you need to add the widget name to Config.cs file. This file is the default config. (This step will not be necessary in the future)