Tilt Five™ Unity API  1.3.0
 
Loading...
Searching...
No Matches
TiltFive.Wand.WandPair Struct Reference

Public Member Functions

 WandPair (WandCore right, WandCore left)
 
bool TryGet (ControllerIndex controllerIndex, out WandCore wandCore)
 

Public Attributes

WandCore RightWand
 
WandCore LeftWand
 

Properties

WandCore this[ControllerIndex controllerIndex] [get]
 

Detailed Description

Definition at line 111 of file Wand.cs.

Constructor & Destructor Documentation

◆ WandPair()

TiltFive.Wand.WandPair.WandPair ( WandCore  right,
WandCore  left 
)

Definition at line 116 of file Wand.cs.

117 {
118 RightWand = right;
119 LeftWand = left;
120 }
WandCore RightWand
Definition: Wand.cs:113
WandCore LeftWand
Definition: Wand.cs:114

References TiltFive.Wand.WandPair.LeftWand, and TiltFive.Wand.WandPair.RightWand.

Member Function Documentation

◆ TryGet()

bool TiltFive.Wand.WandPair.TryGet ( ControllerIndex  controllerIndex,
out WandCore  wandCore 
)

Definition at line 139 of file Wand.cs.

140 {
141 wandCore = this[controllerIndex];
142 return wandCore != null;
143 }

Member Data Documentation

◆ LeftWand

WandCore TiltFive.Wand.WandPair.LeftWand

Definition at line 114 of file Wand.cs.

Referenced by TiltFive.Wand.WandPair.WandPair().

◆ RightWand

WandCore TiltFive.Wand.WandPair.RightWand

Definition at line 113 of file Wand.cs.

Referenced by TiltFive.Wand.WandPair.WandPair().

Property Documentation

◆ this[ControllerIndex controllerIndex]

WandCore TiltFive.Wand.WandPair.this[ControllerIndex controllerIndex]
get

Definition at line 122 of file Wand.cs.

123 {
124 get
125 {
126 switch (controllerIndex)
127 {
128 case ControllerIndex.Right:
129 return RightWand;
130 case ControllerIndex.Left:
131 return LeftWand;
132 default:
133 // TODO: If we get an unexpected value here, should we fail silently or throw an exception?
134 return null;
135 }
136 }
137 }
ControllerIndex
Since wands are all physically identical (they have no "handedness"), it doesn't make sense to addres...

The documentation for this struct was generated from the following file: