void Start()
{
bool debug = true;
running = true;
if (SmartFoxConnection.IsInitialized){
smartFox = SmartFoxConnection.Connection;
}
else{
smartFox = new SmartFox(debug);
}
currentRoom = smartFox.LastJoinedRoom;
clientName = smartFox.MySelf.Name;
if(currentRoom.UserCount == 1){
isPhysX = true;
}
else{
isPhysX = false;
}
smartFox.AddEventListener(SFSEvent.USER_ENTER_ROOM, OnUserEnterRoom);
smartFox.AddEventListener(SFSEvent.USER_EXIT_ROOM, OnUserLeaveRoom);
smartFox.AddEventListener(SFSEvent.USER_COUNT_CHANGE, OnUserCountChange);
smartFox.AddEventListener(SFSEvent.CONNECTION_LOST, OnConnectionLost);
smartFox.AddEventListener(SFSEvent.OBJECT_MESSAGE, OnObjectMessageReceived);
smartFox.AddEventListener(SFSEvent.USER_VARIABLES_UPDATE, OnUserVariablesUpdate);
smartFox.AddEventListener(SFSEvent.ROOM_VARIABLES_UPDATE, OnRoomVariablesUpdate);
}