- Home /
Question by
Finijumper · Aug 12, 2016 at 11:57 AM ·
eventsystemgoogle play gamesservice
How can I use Google Play Services Event system?
I have a script that makes the player jump and I want that every time that the player jumps, the event that I have created increases by 1 to know how many jumps have been done in my game.
I have created the Event in my Google Play Developer Console but I don't how to Implement it to my code. I have already read this: https://developers.google.com/games/services/common/concepts/quests#event_basics
void Update () {
if(Input.GetMouseButtonDown(0) && !EventSystem.current.IsPointerOverGameObject(0)){
if(corrent){
// Hacemos que salte si puede saltar
if(alTerra || !dobleSalt){
GetComponent<AudioSource>().Play();
GetComponent<Rigidbody2D>().velocity = new Vector2(GetComponent<Rigidbody2D>().velocity.x, forçaSalt);
//the increase code should go here I think
//rigidbody2D.AddForce(new Vector2(0, forçaSalt));
if(!dobleSalt && !alTerra){
dobleSalt = true;
}
}
}else{
corrent = true;
NotificationCenter.DefaultCenter().PostNotification(this, "PersonatgeComençaACorrer");
}
}
}
Comment
Your answer

Follow this Question
Related Questions
Failed to get permission info for android.permission.android.permission.READ_CONTACTS 0 Answers
Where can I download version 0.9.39 of the google play services plugin? 1 Answer
When I build my game's update, admob ads don't appear 0 Answers
Google Play services Login fails everytime?? 1 Answer
Google Play Service LogIn Problem 0 Answers