게임 아이디어와 기능

다음에 추가할 기능

플레이어 값

서버가 관리하는 재화, 카운터와 에너지입니다. 프로젝트마다 잔액, 상품과 검증된 변경을 정의하세요.

SDK: develop 브랜치플레이어 세션 필요
Unity
플레이어 값 일러스트
확인할 수 있는 결과

게임에 설정된 잔액과 상품이 표시됩니다. 구매하면 현재 플레이어 상태가 반환됩니다.

동영상 준비 중

이 단계의 동영상은 아직 없습니다. 안내와 MCP 요청은 바로 사용할 수 있습니다.

플레이어 값

같은 프로젝트 준비

  1. 게임 설정과 같은 프로젝트를 대시보드에서 선택하세요.

    플레이어 값 →
  2. 대시보드 양식에서 다음 테스트 항목을 만들거나 기존 항목을 사용하세요. 표시된 값은 현재 프로젝트 데이터가 아닌 예시입니다.

    값
    coins: initialBalance=100, maxBalance=1000000; energy: initialBalance=10, maxBalance=100
    직접 변경 허용
    false
    상품
    energy-pack: costs=[{"key":"coins","amount":20}], rewards=[{"key":"energy","amount":5}]

    초기 잔액은 값 키마다 한 번만 지급됩니다. 직접 변경은 기본적으로 꺼져 있습니다. Validated Actions의 플레이당 제한은 유지되며 일일 한도와 잔액 한도는 이 정의를 따릅니다. 선택 한도를 비우면 제한이 없습니다.

  3. 예제를 실행하기 전에 저장하고 다시 불러와 확인하세요. 관련 없는 정의는 유지하세요.

이 기능 구현하기

가이드는 미리 볼 수 있습니다. 실행하려면 활성 프로젝트 키가 필요합니다. 프로젝트 준비

SDK 설치와 프로젝트 설정 가져오기가 완료되고 플레이어가 로그인해야 합니다.

이 SDK 예제는 develop을 사용합니다. 필요한 API가 설치된 SDK에 있는지 확인하세요.

빠른 시작으로 원하는 플레이어를 연결하세요. 명시적인 버튼이나 씬 동작에서 RunReviewedAction()을 호출하세요. 파일을 여는 것만으로는 요청을 보내지 않습니다.

C#
Assets/Scripts/PlayerValuesDemo.cs
horizOn 호출
1using UnityEngine;
2using PM.horizOn.Cloud.Core;
3using PM.horizOn.Cloud.Manager;
4​
5// Existing SDK/project configuration and authenticated player session required.
6// Call RunReviewedAction explicitly after reviewing this example and its data.
7public sealed class PlayerValuesDemo : MonoBehaviour
8{
9 public async void RunReviewedAction()
10 {
11 var sessionUser = UserManager.Instance.CurrentUser;
12 if (sessionUser == null || !sessionUser.IsValid()) return;
13 var userId = UserManager.Instance.CurrentUser.UserId;
14 var current = await PlayerValuesManager.Instance.GetState(userId);
15 if (!current.IsSuccess) { Debug.LogWarning(current.ErrorCode); return; }
16 foreach (var value in current.State.values) Debug.Log(value.key + "=" + value.balance);
17 // This minimal first call reads authoritative balances, never a local reward delta.
18 // For purchases and original retry, import PlayerValuesExample and its
19 // PendingPlayerValuesPurchase helper from the official SDK samples.
20 // Persist the complete original user/offer/operationId before one send.
21 // An uncertain or expired original must never become a fresh purchase ID.
22 }
23}
전체 SDK 예제 열기 ↗

새 기능을 테스트하세요.

게임에 설정된 잔액과 상품이 표시됩니다. 구매하면 현재 플레이어 상태가 반환됩니다.

게임 설정과 같은 프로젝트를 대시보드에서 선택하세요.

엔드포인트
  • GET/player-values
  • GET/player-values/offers
  • POST/player-values/purchase
  • POST/player-values/adjust
API 레퍼런스의 모든 엔드포인트
다음 단계에 대한 추천

모든 라운드에 최고 점수를 더하세요.

라운드가 끝나면 점수를 저장하고 선두를 보여주세요. 기존 연결과 플레이어 세션을 계속 사용하세요.