Class vCast_Controller
vCast Controller device.
vCast 控制器裝置。
Inheritance
Namespace: Votanic.vXR.vCast
Assembly: Votanic.vXR.dll
Syntax
[AddComponentMenu("")]
public class vCast_Controller : MonoBehaviour
Fields
currentTool
The current tool of controller.
控制器目前的工具。
Declaration
[Header("[Status]")]
[Tooltip("The current tool of controller.\n控制器目前的工具。")]
public ControllerTool currentTool
Field Value
Type | Description |
---|---|
ControllerTool |
defaultTool
The name of default tool of controller.
控制器預設工具的名稱。
Declaration
[Header("[Settings]")]
[Tooltip("The name of default tool of controller.\n控制器預設工具的名稱。")]
public string defaultTool
Field Value
Type | Description |
---|---|
System.String |
grabbedObject
Grabbed interactables.
被抓握的交互物。
Declaration
[Tooltip("Grabbed interactables.\n被抓握的交互物。")]
public vCast_Interactables grabbedObject
Field Value
Type | Description |
---|---|
vCast_Interactables |
selectedObject
Selected interactables.
被點選的交互物。
Declaration
[Tooltip("Selected interactables.\n被點選的交互物。")]
public vCast_Interactables selectedObject
Field Value
Type | Description |
---|---|
vCast_Interactables |
tools
Tools list of controller.
控制器工具列。
Declaration
[Tooltip("Tools list of controller.\n控制器工具列。")]
public List<ControllerTool> tools
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<ControllerTool> |
triggeredObject
Triggered interactables.
被觸動的交互物。
Declaration
[Tooltip("Triggered interactables.\n被觸動的交互物。")]
public vCast_Interactables triggeredObject
Field Value
Type | Description |
---|---|
vCast_Interactables |
Properties
glove
Glove tool of vCast controller.
vCast 控制器的手套工具。
Declaration
public vCast_Glove glove { get; }
Property Value
Type | Description |
---|---|
vCast_Glove |
teleport
The teleport tool of controller.
控制器的傳送工具。
Declaration
public vCast_Teleport teleport { get; }
Property Value
Type | Description |
---|---|
vCast_Teleport |
wand
The wand tool of controller.
控制器的操縱桿工具。
Declaration
public vCast_Wand wand { get; }
Property Value
Type | Description |
---|---|
vCast_Wand |
Methods
AlwaysOnTop(Boolean)
Decide the wand ray is always display on top or not.
決定操縱桿射線是否永遠置頂顯示。
AlwaysOnTop(false)
Declaration
public void AlwaysOnTop(bool onTop)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | onTop | Always on top if true |
DisplayGlove(Boolean)
Show or hide glove.
顯示或隱藏手套。
DisplayGlove(false)
Declaration
public void DisplayGlove(bool display)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | display | Display if true |
DisplayWandRay(Boolean)
Show or hide wand ray.
顯示或隱藏控制器射線。
DisplayWandRay(true)
Declaration
public void DisplayWandRay(bool display)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | display | Display if true |
Drop()
Drop the picked interactables.
放下拾起中的交互物。
Declaration
public void Drop()
EnableWandRay(Boolean)
Enable or disable wand ray.
啟用或停用操縱桿射線。
EnableWandRay(true)
Declaration
public void EnableWandRay(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | Enable if true |
GetTool(Int32)
Get controller tool from tool list.
在工具列中取得控制器工具。
GetTool(0)
Declaration
public ControllerTool GetTool(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Tool index |
Returns
Type | Description |
---|---|
ControllerTool |
GetTool(String)
Get controller tool from tool list.
在工具列中取得控制器工具。
GetTool("Wand")
Declaration
public ControllerTool GetTool(string tool)
Parameters
Type | Name | Description |
---|---|---|
System.String | tool | Tool name |
Returns
Type | Description |
---|---|
ControllerTool |
Grab()
Force grab the selected grabbable interactables.
強制抓握點選中的可抓握的交互物。
Declaration
public void Grab()
Pick()
Pick the selected interactables.
拾起點選中的交互物。
Declaration
public void Pick()
Pick(vCast_Interactables)
Force pick the selected interactables.
強制拾起點選中的交互物。
Pick(interactables)
Declaration
public void Pick(vCast_Interactables interactables)
Parameters
Type | Name | Description |
---|---|---|
vCast_Interactables | interactables | Target interactables |
RenderQueue(Int32)
Set the Render Queue of wand ray materials.
設定操縱桿射線物料的渲染隊列。
RenderQueue(3000)
Declaration
public void RenderQueue(int renderQueue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | renderQueue | Target queue |
ResetRay()
Reset wand ray setting.
重置操縱桿射線設定。
Declaration
public void ResetRay()
ResetTool(Int32)
Reset controller tool setting.
重置控制器工具的設定。
ResetTool(0)
Declaration
public void ResetTool(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Tool index |
ResetTool(String)
Reset controller tool setting.
重置控制器工具的設定。
ResetTool("Wand")
Declaration
public void ResetTool(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Tool name |
ResetTools()
Reset controller tools setting.
重置控制器所有工具的設定。
Declaration
public void ResetTools()
SetDetectLayers(Int32[])
Set detectable layers of current tool.
設定目前工具可偵測的層級。
SetDetectLayers(8, 28)
Declaration
public void SetDetectLayers(params int[] layers)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | layers | Target layers |
SetDisableColor(Color)
Set the wand ray color on disable state.
設定停用狀態下的操縱桿射線顏色。
SetDisableColor(Color.grey)
Declaration
public void SetDisableColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Color | color | Target color |
SetDisableOnTopAlpha(Single)
Set the wand ray on top alpha on disable state.
設定停用狀態下的操縱桿射線不透明度。
SetDisableOnTopAlpha(0)
Declaration
public void SetDisableOnTopAlpha(float alpha)
Parameters
Type | Name | Description |
---|---|---|
System.Single | alpha | Target alpha |
SetGloveRadius(Single)
Set the scan radius of glove.
設定手套掃瞄半徑。
SetGloveRadius(0.1f)
Declaration
public void SetGloveRadius(float radius)
Parameters
Type | Name | Description |
---|---|---|
System.Single | radius | Scan radius |
SetIgnoreLayers(Int32[])
Set ignored layers of current tool.
設定目前工具忽略的層級。
SetIgnoreLayers(31)
Declaration
public void SetIgnoreLayers(params int[] layers)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | layers | Target layers |
SetMaxLength(Single)
Set the maximum wand ray length.
設定操縱桿射線最長長度。
SetMaxLength(2)
Declaration
public void SetMaxLength(float length)
Parameters
Type | Name | Description |
---|---|---|
System.Single | length | Maximum length |
SetNormalColor(Color)
Set the wand ray color on normal state.
設定正常狀態下的操縱桿射線顏色。
SetNormalColor(Color.white)
Declaration
public void SetNormalColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Color | color | Target color |
SetNormalOnTopAlpha(Single)
Set the wand ray on top alpha on normal state.
設定正常狀態下的操縱桿射線不透明度。
SetNormalOnTopAlpha(0)
Declaration
public void SetNormalOnTopAlpha(float alpha)
Parameters
Type | Name | Description |
---|---|---|
System.Single | alpha | Target alpha |
SetNormalOutline(Outline)
Set the glove outline on normal state.
設定正常狀態下的手套輪廓。
SetNormalOutline(new Outline())
Declaration
public void SetNormalOutline(Outline outline)
Parameters
Type | Name | Description |
---|---|---|
Outline | outline | Target outline |
SetPressColor(Color)
Set the wand ray color on press state.
設定按住狀態下的操縱桿射線顏色。
SetPressColor(Color.red)
Declaration
public void SetPressColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Color | color | Target color |
SetPressOnTopAlpha(Single)
Set the wand ray on top alpha on press state.
設定按住狀態下的操縱桿射線不透明度。
SetPressOnTopAlpha(0.25f)
Declaration
public void SetPressOnTopAlpha(float alpha)
Parameters
Type | Name | Description |
---|---|---|
System.Single | alpha | Target alpha |
SetPressOutline(Outline)
Set the glove outline on press state.
設定按住狀態下的手套輪廓。
SetPressOutline(new Outline())
Declaration
public void SetPressOutline(Outline outline)
Parameters
Type | Name | Description |
---|---|---|
Outline | outline | Target outline |
SetSelectColor(Color)
Set the wand ray color on select state.
設定點選狀態下的操縱桿射線顏色。
SetSelectColor(Color.green)
Declaration
public void SetSelectColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Color | color | Target color |
SetSelectOnTopAlpha(Single)
Set the wand ray on top alpha on select state.
設定點選狀態下的操縱桿射線不透明度。
SetSelectOnTopAlpha(0.25f)
Declaration
public void SetSelectOnTopAlpha(float alpha)
Parameters
Type | Name | Description |
---|---|---|
System.Single | alpha | Target alpha |
SetSelectOutline(Outline)
Set the glove outline on select state.
設定點選狀態下的手套輪廓。
SetSelectOutline(new Outline())
Declaration
public void SetSelectOutline(Outline outline)
Parameters
Type | Name | Description |
---|---|---|
Outline | outline | Target outline |
SetTool(Int32)
Change controller tool.
更換控制器工具。
SetTool(0)
Declaration
public void SetTool(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Tool index |
SetTool(Int32, Boolean)
Change controller tool.
更換控制器工具。
SetTool(0, true)
Declaration
public void SetTool(int index, bool autoSwitch)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Tool index |
System.Boolean | autoSwitch | Enable auto switch tool if true |
SetTool(String)
Change controller tool.
更換控制器工具。
SetTool("Wand")
Declaration
public void SetTool(string tool)
Parameters
Type | Name | Description |
---|---|---|
System.String | tool | Tool name |
SetTool(String, Boolean)
Change controller tool.
更換控制器工具。
SetTool("Wand", true)
Declaration
public void SetTool(string tool, bool autoSwitch)
Parameters
Type | Name | Description |
---|---|---|
System.String | tool | Tool name |
System.Boolean | autoSwitch | Enable auto switch tool if true |
Teleport()
Transform user to teleport point.
將使用者變換到傳送地點。
Declaration
public virtual void Teleport()
Ungrab()
Force ungrab the grabbed interactables.
強制放開抓握中的交互物。
Declaration
public void Ungrab()