Simple Question, what's the syntax for regis/unregis event in Unity API with java?
SmartFoxClientAPI.SFSEvent.onConnection = OnConnection;
seems to be working while '+= and -=' give out error. So ...how do we unregister Event in Java?
Trying to keep everything under Java here.
Registering SFSEvent in Unity API with Java
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
I dont think I've ever have heard of anyone trying to use the API the way you try it.
Your problem isnt really API related though, but more JavaScript/UnityScript related. If I were you I would try the mono or the Unity forums to find an answer on how to register multiple delegates similar to the -= and += in C#
But in general I would maybe advice you to rethink the usage of JavaScript together with the API if you are doing a commercial game - its certainly not supported in this end, it is not tested and you are more or less on your own from help.
With that said Unity/mono compiles everything down to the same .NET binary soup. So theoretically its all the same once it has run through the compiler.
Sorry
/T
Your problem isnt really API related though, but more JavaScript/UnityScript related. If I were you I would try the mono or the Unity forums to find an answer on how to register multiple delegates similar to the -= and += in C#
But in general I would maybe advice you to rethink the usage of JavaScript together with the API if you are doing a commercial game - its certainly not supported in this end, it is not tested and you are more or less on your own from help.
With that said Unity/mono compiles everything down to the same .NET binary soup. So theoretically its all the same once it has run through the compiler.
Sorry
/T
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
Sorry man - but JavaSript/UnityScript has absolutely nothing to do with Java. Just to clear that part up. C# isnt like C at all either.
I actually code in C# because I am a Java developer, and C# is a lot more similar to Java than JavaScript/UnityScript is. You should really give it a shot if you like Java
But really - I am sorry that I cant help here. You should not despair - again depending on what it is you are trying to do (commercial game vs. playing around on your own), you can still work with JavaScript/UnityScript in most of your game. You could write a thin C# network manager that you can access from your JavaScript/UnityScript game code, which handles all your delegates and callbacks - that way you have isolated the problem and do not have to port your entire game code to C#.
Just an idea
/Thomas
I actually code in C# because I am a Java developer, and C# is a lot more similar to Java than JavaScript/UnityScript is. You should really give it a shot if you like Java
But really - I am sorry that I cant help here. You should not despair - again depending on what it is you are trying to do (commercial game vs. playing around on your own), you can still work with JavaScript/UnityScript in most of your game. You could write a thin C# network manager that you can access from your JavaScript/UnityScript game code, which handles all your delegates and callbacks - that way you have isolated the problem and do not have to port your entire game code to C#.
Just an idea
/Thomas
Return to “.Net / Unity3D API”
Who is online
Users browsing this forum: No registered users and 22 guests