質問

I have some basic questions that I couldn't figure out after searching for quite some time now. All tutorials and guides I've come across have the code already set up and I can't find them of much use. For instance, the Friend Smash example has the code integrated with buttons and other scripts that I can't use it in my own game.

I used Parse to upload my game and test it on facebook and it's working fine, but I want to add the social features to it (login, share, score etc.)

Picking up the code snippets that I'm supposed to use either brings me up errors (undefined variables etc.) or messes things up (I get the not-working, bugged login window on top of the running game inside Unity, while nothing happens if I build and run it).

Where am I supposed to put the code? For example: https://developers.facebook.com/docs/unity/reference/current/FB.Init In the "Example" part, where am I supposed to put this line? FB.Init(SetInit, OnHideUnity);

Same thing here: https://developers.facebook.com/docs/unity/reference/current/FB.Feed If I use the "Example" code as it is I get errors.

Do I have to use specific names for the scripts?

This is my first time uploading a game and trying to add social features to it so these questions may seem simple, but I couldn't find an answer anywhere.

役に立ちましたか?

解決

You should create your own class instead of "Example" class, where you put all your Facebook specific functions. Then you should invoke your methods with your own components, buttons, triggers, whatever.

It is also you, who should take care of pausing the game while running social functions (login, share etc.).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top