C# Класс 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.
Наследование: MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Instance NaviMobileManager,

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

Awake() публичный Метод

Initalize before the scene loads
public Awake ( ) : void
Результат void

Connect() публичный Метод

Method to connect to a given device
public Connect ( string ip ) : bool
ip string The ip address to connect to
Результат bool

SendCurrentSize() публичный Метод

Send the size of the smart device to the VR device
public SendCurrentSize ( ) : void
Результат void

SendDeviceType() публичный Метод

Send the device / platform type of the smart device to the VR device
public SendDeviceType ( ) : void
Результат void

SplitIP_Message() публичный Метод

public SplitIP_Message ( string message ) : string[]
message string
Результат string[]

Start() публичный Метод

Always keep screen on to keep app alive and start listening for the ipAddress
public Start ( ) : void
Результат void

StartReceivingIP() публичный Метод

This method begins the process of listening to all messages sent on the router.
public StartReceivingIP ( ) : void
Результат void

Update() публичный Метод

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
Результат void

Описание свойств

Instance публичное статическое свойство

public static NaviMobileManager, Instance
Результат NaviMobileManager,