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: Events | Play Games Services | Google for Developers
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");
}
}
}