Hey guys!
I’m currently porting a simple 2D game from Unity to cocos-2dx using JS bingding
I wonder how can I run platform specific code.
For instance, let’s say I’d like to use game center os iOS
if(cc.sys.os == cc.sys.OS_IOS)
{
// load game center info
}
Or if I’m targeting web and I want to use facebook
if(cc.sys.os == cc.sys.DESKTOP_BROWSER)
{
// load facebook SDK js
}
Is there any other way to do that? Maybe an elegant way?
Cheers!