Tilt Five Unity API  1.3.0
Classes | Static Public Member Functions | Private Attributes | List of all members
TiltFive.Player Class Reference

Provides access to player settings and functionality. More...

Inheritance diagram for TiltFive.Player:
TiltFive.Singleton< Player >

Classes

class  PlayerCore
 

Static Public Member Functions

static bool IsConnected (PlayerIndex playerIndex)
 Determines whether the specified player has an associated pair of glasses connected. More...
 
static bool TryGetFriendlyName (PlayerIndex playerIndex, out string friendlyName)
 Attempts to get the friendly name assigned to the specified player's glasses. More...
 

Private Attributes

Dictionary< PlayerIndex, PlayerCoreplayers = new Dictionary<PlayerIndex, PlayerCore>()
 

Additional Inherited Members

- Protected Member Functions inherited from TiltFive.Singleton< Player >
 Singleton ()
 
- Properties inherited from TiltFive.Singleton< Player >
static T Instance [get]
 

Detailed Description

Provides access to player settings and functionality.

Definition at line 15 of file Player.cs.

Member Function Documentation

◆ IsConnected()

static bool TiltFive.Player.IsConnected ( PlayerIndex  playerIndex)
static

Determines whether the specified player has an associated pair of glasses connected.

Parameters
playerIndex
Returns

Definition at line 32 of file Player.cs.

33  {
34  return playerIndex != PlayerIndex.None && Instance.players.TryGetValue(playerIndex, out var playerCore);
35  }
PlayerIndex
The Player index (e.g. Player One, Player Two, etc)

References TiltFive.Singleton< Player >.Instance.

Referenced by TiltFive.SplitStereoCamera.OnRenderImage(), and TiltFive.Glasses.GlassesCore.Update().

◆ TryGetFriendlyName()

static bool TiltFive.Player.TryGetFriendlyName ( PlayerIndex  playerIndex,
out string  friendlyName 
)
static

Attempts to get the friendly name assigned to the specified player's glasses.

Parameters
playerIndex
friendlyName
Returns

Definition at line 44 of file Player.cs.

45  {
46  if (playerIndex == PlayerIndex.None || !Instance.players.TryGetValue(playerIndex, out var playerCore))
47  {
48  friendlyName = "";
49  return false;
50  }
51 
52  friendlyName = playerCore.FriendlyName;
53  return true;
54  }

References TiltFive.Singleton< Player >.Instance.

Member Data Documentation

◆ players

Dictionary<PlayerIndex, PlayerCore> TiltFive.Player.players = new Dictionary<PlayerIndex, PlayerCore>()
private

Definition at line 19 of file Player.cs.


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