FYI: This is one of two topics of our 4th Meteor Meetup, take place on 17th September, 2016. The author is Huy Trinh, a young talent member of Designveloper.
Those who were not able to attend our 4th Meteor Ho Chi Minh meetup at September 17th could find all about Multiplayer Game with Unity3D and Meteor – one of the main topics of the meetup – in this blog.
Before digging into every facet of this post, you are required to have a fairly good background of Meteor and Unity3D.
What is Unity3D?
Unity is a cross-platform game engine developed by Unity Technologies and used to develop video games for PC, consoles, mobile devices and websites. First announced only for OS X, at Apple’s Worldwide Developers Conference in 2005, it has since been extended to target 24 platforms.
What is Meteor JS?
Why we should use Meteor with Unity3D?
How to connect MeteorJS with Unity3D
A team in Los Angeles have developed a plugin that make a bridge between Unity3D and MeteorJS through Websocket and DDP. You can find it here https://github.com/hiddenswitch/Meteor-Unity. By using this plugin we can use almost Meteor API such as: login, method, collection, publish/subscription. The plugin is great in general but one thing, it hasn’t supported WebGL for Unity3D yet.
You can watch how to setup and connect step by step here: https://github.com/hiddenswitch/Meteor-Unity
SendMessage ('MyGameObject', 'MyFunction', 'foobar');
Read more here: https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.htmlTo calls a function in the web page that contains the WebGL Player.
ExternalCall calls functionName in the web page containing the WebGL player, passing the given arguments to it. Supported argument types are the primitive types (string, int, float, string) and arrays of such types. Any other objects are converted to string using ToString and passed as strings.
For a deeper understanding, you can read here: https://docs.unity3d.com/ScriptReference/Application.ExternalCall.html
So, did you find some great information of your own in this blog? Do you have any questions? Let me know in the comments and we can discuss about it!