Connector

The Connector example shows how to setup and use the SmartFox client API object, establish a connection to the server and login. It also shows how to deal with the different requirements of the Unity build targets, making use of a few conditional compilation statements.
The example also features the logic needed to activate the protocol cryptography. This will be discussed at the bottom of this tutorial.
The Unity project consists of a single scene with a canvas containing two game objects (called "panels") representing the initial login view and a generic main view acting as a placeholder for what comes after a successful login. On the login view the user can enter their name and hit the button to connect to SmartFoxServer and execute the login process.
The example features a single script component. A number of properties exposed in the Editor's Inspector panel allow configuring the connection parameters and API logging behavior.
Source code
- Get the full examples pack from the SmartFoxServer website
- Get this example source from the Unity Asset Store
The porting of this tutorial from the SmartFoxServer 2X documentation is still in progress. We apologize for the inconvenience.