C# Class NaviMobileManager, Navi

This is the class that handles the network connections between the smart device and the PC. It is also responsbile for updating the instructions or images shown if any. There are two phases to the network connection. The first is where the mobile device listens for an ipAddress being broadcasted by the VR device. The second step is connecting to that ipAddress in order to send data wirelesssly.
Inheritance: MonoBehaviour
Exibir arquivo Open project: vmohan7/Navi Class Usage Examples

Public Properties

Property Type Description
Instance NaviMobileManager,

Public Methods

Method Description
Awake ( ) : void

Initalize before the scene loads

Connect ( string ip ) : bool

Method to connect to a given device

SendCurrentSize ( ) : void

Send the size of the smart device to the VR device

SendDeviceType ( ) : void

Send the device / platform type of the smart device to the VR device

SplitIP_Message ( string message ) : string[]
Start ( ) : void

Always keep screen on to keep app alive and start listening for the ipAddress

StartReceivingIP ( ) : void

This method begins the process of listening to all messages sent on the router.

Update ( ) : void

Handles sending all data to the VR display, this includes pose data via the naviPoseconnection and touch data via the rpcConnection It also handles receiving any data from the VR display. Currently, it just listens for which connection should send which type of data

Private Methods

Method Description
AnimateObj ( GameObject gObject, Vector3 dest, float timeInSec ) : IEnumerator

Animates an object to move to a given destination

CallMethod ( GameObject gObject, string componentName, string methodName, object serializedParams ) : void

Enables the SDK to update any component that is set by the asset bundle

ClearKeyboard ( ) : void

Method to clear the keyboard

CloseKeyboard ( ) : void

Method to close the keyboard

CreateSocket ( ) : void

Creates a socket using the Unity Transport layer. This is a UDP connection that will support two channels of communication.

DecodeObject ( object obj ) : object

Decodes the Object's class recusively

HandleAssetBundle ( RPCSerializer, rpcData ) : void
HandleBigRPC ( byte recBuffer ) : void

Method to parse and recieve image RPC from big data sources like an image

HandleRPC ( byte recBuffer ) : void

Method to parse and send an RPC event from smart device such as recieving touch input

OnDisconnect ( int connectionID ) : void

This method handles when the VR display disconnects in order to restart the app and listen for a new connection

ReceiveData ( IAsyncResult result ) : void

This method continously listens for a reset command or a possible ipAddress to connect to

RequestKeyboard ( string initalText, bool hideInput ) : void

Method to open the mobile keyboard with the given text

SendKeyboardText ( ) : void

If the keyboard is open, then send the text that is currently typed to the VR device

SetDeviceNumber ( int playerNumber ) : void

Sets the text to display to the controller number

SetDeviceOrientation ( ScreenOrientation, orient, bool canUserChange ) : void

Fixes the device orientation in a given way that is depenedent on the VR device

SetInstruction ( string instruction ) : void

Sets the text to display to the user

UpdateProperty ( GameObject gObject, string componentName, string propName, object value, object index ) : void

Enables the SDK to update any component that is set by the asset bundle

Method Details

Awake() public method

Initalize before the scene loads
public Awake ( ) : void
return void

Connect() public method

Method to connect to a given device
public Connect ( string ip ) : bool
ip string The ip address to connect to
return bool

SendCurrentSize() public method

Send the size of the smart device to the VR device
public SendCurrentSize ( ) : void
return void

SendDeviceType() public method

Send the device / platform type of the smart device to the VR device
public SendDeviceType ( ) : void
return void

SplitIP_Message() public method

public SplitIP_Message ( string message ) : string[]
message string
return string[]

Start() public method

Always keep screen on to keep app alive and start listening for the ipAddress
public Start ( ) : void
return void

StartReceivingIP() public method

This method begins the process of listening to all messages sent on the router.
public StartReceivingIP ( ) : void
return void

Update() public method

Handles sending all data to the VR display, this includes pose data via the naviPoseconnection and touch data via the rpcConnection It also handles receiving any data from the VR display. Currently, it just listens for which connection should send which type of data
public Update ( ) : void
return void

Property Details

Instance public_oe static_oe property

public static NaviMobileManager, Instance
return NaviMobileManager,