Tilt Five Unity API  1.3.0
Public Member Functions | Public Attributes | Properties | List of all members
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 110 of file Wand.cs.

Constructor & Destructor Documentation

◆ WandPair()

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

Definition at line 115 of file Wand.cs.

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

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 138 of file Wand.cs.

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

Member Data Documentation

◆ LeftWand

WandCore TiltFive.Wand.WandPair.LeftWand

Definition at line 113 of file Wand.cs.

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

◆ RightWand

WandCore TiltFive.Wand.WandPair.RightWand

Definition at line 112 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 121 of file Wand.cs.

122  {
123  get
124  {
125  switch (controllerIndex)
126  {
127  case ControllerIndex.Right:
128  return RightWand;
129  case ControllerIndex.Left:
130  return LeftWand;
131  default:
132  // TODO: If we get an unexpected value here, should we fail silently or throw an exception?
133  return null;
134  }
135  }
136  }
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: