C# Class UnityEngine.Networking.NetworkDiscovery

Inheritance: UnityEngine.MonoBehaviour
Show file Open project: CarlosHBC/UnityDecompiled Class Usage Examples

Public Methods

Method Description
Initialize ( ) : bool

Initializes the NetworkDiscovery component.

OnReceivedBroadcast ( string fromAddress, string data ) : void

This is a virtual function that can be implemented to handle broadcast messages when running as a client.

StartAsClient ( ) : bool

Starts listening for broadcasts messages.

StartAsServer ( ) : bool

Starts sending broadcast messages.

StopBroadcast ( ) : void

Stops listening and broadcasting.

Private Methods

Method Description
BytesToString ( byte bytes ) : string
OnDestroy ( ) : void
OnGUI ( ) : void
StringToBytes ( string str ) : byte[]
Update ( ) : void

Method Details

Initialize() public method

Initializes the NetworkDiscovery component.

public Initialize ( ) : bool
return bool

OnReceivedBroadcast() public method

This is a virtual function that can be implemented to handle broadcast messages when running as a client.

public OnReceivedBroadcast ( string fromAddress, string data ) : void
fromAddress string The IP address of the server.
data string The data broadcast by the server.
return void

StartAsClient() public method

Starts listening for broadcasts messages.

public StartAsClient ( ) : bool
return bool

StartAsServer() public method

Starts sending broadcast messages.

public StartAsServer ( ) : bool
return bool

StopBroadcast() public method

Stops listening and broadcasting.

public StopBroadcast ( ) : void
return void