Estadísticas de jugador

Estadísticas de jugador

Registra contadores y mejores marcas de cada jugador.

Comenzar gratis

Estadísticas de jugador

Registra contadores y mejores marcas de cada jugador.

SDK y REST

Integra Unity, Godot o Unreal, o usa la interfaz REST.

Panel del proyecto

Configura cada función y gestiona sus datos actuales en tu proyecto.

Integración rápida

Integración rápida

Estadísticas de jugador
Vídeo próximamente

Registra rondas, bajas y récords en un lote por sesión, con reglas de suma, máximo, mínimo o último valor.

Integración rápida
Unity (C#)
using UnityEngine;
using PM.horizOn.Cloud.Manager;
using PM.horizOn.Cloud.Objects.Network.Requests;

var manager = StatisticsManager.Instance;
var snapshot = await manager.GetStatistics();
if (snapshot == null) { Debug.LogWarning(manager.LastErrorCode); return; }
string pendingKey = "horizOn_statistics_pending_" + snapshot.userId;
var pending = PlayerPrefs.HasKey(pendingKey)
    ? JsonUtility.FromJson<UpdateStatisticsRequest>(PlayerPrefs.GetString(pendingKey))
    : new UpdateStatisticsRequest {
        userId = snapshot.userId, operationId = manager.CreateOperationId(),
        updates = new[] { new StatisticUpdate("kills", 3), new StatisticUpdate("best_score", 250) }
    };
string originalJson = JsonUtility.ToJson(pending);
PlayerPrefs.SetString(pendingKey, originalJson);
PlayerPrefs.Save();
var result = await manager.UpdateStatistics(pending.updates, pending.operationId);
if (result == null) {
    // Keep the saved ID and batch. Reconcile OPERATION_EXPIRED before a new logical report.
    Debug.LogWarning(manager.LastErrorCode);
    return;
}
// A late success for O1 must never acknowledge a newer pending O2.
if (PlayerPrefs.GetString(pendingKey, null) == originalJson) {
    PlayerPrefs.DeleteKey(pendingKey);
    PlayerPrefs.Save();
}
foreach (var counter in result.values) Debug.Log(counter.key + "=" + counter.value);

Estos ejemplos usan el SDK de Unity (C#) y la API REST. Godot y Unreal tienen las mismas llamadas en sus propios SDK: consulta el inicio rápido

Preguntas frecuentes

Preguntas frecuentes

¿Listo para integrar?

Empiece a construir con horizOn hoy. Nivel gratuito incluido.