Eventos em jogos do Unity
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Este tópico descreve como usar os eventos dos serviços relacionados a jogos do Google Play em jogos
do Unity.
Antes de começar
Configure seu projeto do Unity e o plug-in do Google Play Games para Unity. Para
saber mais, consulte o Guia para iniciantes.
Criar eventos
Use o Google Play Console para criar eventos. Para saber mais, consulte o
guia de eventos
dos serviços relacionados a jogos do Google Play. Depois de
criar eventos, adicione os recursos do Android no plug-in, conforme descrito
no guia para iniciantes.
Gravar eventos
Para incrementar um evento, chame este método:
using GooglePlayGames;
...
// Increments the event with Id "YOUR_EVENT_ID" by 1
PlayGamesPlatform.Instance.Events.IncrementEvent("YOUR_EVENT_ID", 1);
Você só precisa fazer a chamada uma vez. Esse método processa a criação de lotes e a execução em
segundo plano.
O conteúdo e os exemplos de código nesta página estão sujeitos às licenças descritas na Licença de conteúdo. Java e OpenJDK são marcas registradas da Oracle e/ou suas afiliadas.
Última atualização 2025-07-27 UTC.
[null,null,["Última atualização 2025-07-27 UTC."],[],[],null,["# Events in Unity games\n\nThis topics describes how to use Play Games Services events in Unity\ngames.\n\nBefore you get started\n----------------------\n\nSet up your Unity project and the Google Play Games plugin for Unity. For\ndetails, see the [Get started guide](/games/pgs/unity/unity-start).\n\nCreate events\n-------------\n\nYou create events in Google Play Console. For details, see the\n[events guide](/games/pgs/events#create-event) for Play Games Services. After\nyou create your events, add their Android resources to the plugin as described\nin the [get started guide](/games/pgs/unity/unity-start).\n\nRecord events\n-------------\n\nTo increment an event, call the following method: \n\n using GooglePlayGames;\n ...\n // Increments the event with Id \"YOUR_EVENT_ID\" by 1\n PlayGamesPlatform.Instance.Events.IncrementEvent(\"YOUR_EVENT_ID\", 1);\n\nYou only need to make this call once. It handles batching and execution in the\nbackground."]]