Unity 5 examples package

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

Post Reply
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Unity 5 examples package

Post by Bax »

We just published a new examples package specifically targeted at Unity 5.
It contains the updated versions of all the examples from the previous package, with a renewed interface (now featuring the UI system introduced in Unity 4.6) and full compatibility with Unity's WebGL build (except the FPS example, which requires UDP communication, not available in WebGL).
The package contains these examples:
- Connector
- Lobby
- Buddy Messenger
- Tris
- Object Movement
- MMORoom Demo
- First Person Shooter
- SpaceWar
The download link available on this page: http://www.smartfoxserver.com/download/sfs2x#p=examples

PS
We will soon make the renewed examples available in the Unity Asset Store too, upgrading the current package.
Paolo Bax
The SmartFoxServer Team
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Unity 5 examples package

Post by Bax »

A new example called Advanced Connector has been added to the Unity 5 examples package.
It expands the very basic Connector example, adding the logic needed to activate the protocol cryptography that was introduced in SmartFoxServer 2X starting from version 2.10. It also shows how to handle multiple Unity builds with a bit of conditional compilation.
Paolo Bax
The SmartFoxServer Team
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Unity 5 examples package

Post by Bax »

All Unity tutorials in the SmartFoxServer 2X doc website have been updated to match the newly released examples:
http://docs2x.smartfoxserver.com/Exampl ... troduction
Paolo Bax
The SmartFoxServer Team
ValeZumzum
Posts: 1
Joined: 09 Oct 2015, 19:51

Re: Unity 5 examples package

Post by ValeZumzum »

I tested the ObjectMovement Example in Unity 5.2.1 with WebPlayer platform and it works ok.
Nnow i'm trying to run it with WebGL. The login is working ok, but, when another player connects and moves, it throws an exception when trying to convert user.GetVariable("x").GetDoubleValue() to float (in the OnUserVariableUpdate method).
Debugging, I saw that the value returned by GetDoubleValue is 0, while debugging with WebPlayer the value is 0.0. I think that's why it can't cast that value to float.
Maybe it's a problem with the way the web socket handles the data?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Unity 5 examples package

Post by Bax »

Sorry for the late reply.
We will investigate in the next few days and report our findings.
Paolo Bax
The SmartFoxServer Team
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Unity 5 examples package

Post by Bax »

ValeZumzum wrote:I tested the ObjectMovement Example in Unity 5.2.1 with WebPlayer platform and it works ok.
Nnow i'm trying to run it with WebGL. The login is working ok, but, when another player connects and moves, it throws an exception when trying to convert user.GetVariable("x").GetDoubleValue() to float (in the OnUserVariableUpdate method).
Debugging, I saw that the value returned by GetDoubleValue is 0, while debugging with WebPlayer the value is 0.0. I think that's why it can't cast that value to float.
Maybe it's a problem with the way the web socket handles the data?
Are you using the latest version of the example and API, or did you make any change to the code? Because in my tests I can't replicate the issue. I run two WebGL clients and Unity Editor at the same time and no exception is thrown.
Paolo Bax
The SmartFoxServer Team
Post Reply