Moderation SDK 연동
Moderation 대시보드에 액세스하고 이를 사용하는 방법을 알아봅니다.
읽는 시간 1분최근 업데이트: 23일 전
Unity Moderation을 시작하기 전에 모든 요구 사항이 충족되어야 합니다.
프로젝트에서 Safe Text가 활성화되어 있으면 Unity Dashboard 내에서 Moderation 대시보드에 액세스할 수 있습니다.
Safe Text 기술 자료의 단계에 따라 프로젝트에서 제품을 활성화할 수 있습니다.
프로젝트에 Safe Text가 추가되면 다음 단계를 따릅니다.
Moderation이 프로젝트에 적용되면 프로젝트의 다른 구성원에게 안전 관리자(Safety Admin)와 안전 중재자(Safety Moderator)라는 사용자 역할을 할당하여 리포트 검토를 시작합니다.
Moderation 엔드포인트가 allowlist에 있는지 확인
프로젝트에서 액세스 제어를 사용하는 경우 기본값으로 거부(Deny by Default)가 적용되어 있을 수도 있습니다.
이 경우, Moderation SDK가 Moderation 서비스로 리포트를 전송할 수 있도록 플레이어에게 리포트 전송 권한을 부여해야 합니다.
프로젝트에 다음 정책을 추가하여 플레이어가 리포트를 보낼 수 있는 권한을 부여합니다.
{ "Sid": "allow-moderation-report", "Action": ["*"], "Effect": "Allow", "Principal": "Player", "Resource": "urn:ugs:moderation-report:/*"}
Moderation SDK 임포트
Unity Dashboard에 프로젝트를 연결한 후, 최신 버전의 Moderation 패키지를 설치할 수 있습니다.
Unity 패키지 관리자를 사용하여 Unity 에디터에 Moderation 패키지를 임포트합니다.
Unity 서비스 초기화
Moderation SDK는 플레이어를 신고할 수 있는 클래스의 싱글톤 인스턴스를 표시합니다. 이를 사용하려면 Unity 서비스를 초기화하고 UAS(Unity Authentication 서비스)로 플레이어를 인증합니다.
다음은 UAS를 사용하여 사용자를 인증하는 방법의 예제를 보여 주는 코드입니다.
using Unity.Services.Core;using Unity.Services.Authentication;async void Start(){ await UnityServices.InitializeAsync(); await AuthenticationService.Instance.SignInAnonymouslyAsync(); if (AuthenticationService.Instance.IsSignedIn) { // game code. } else { Debug.Log("Player was not signed in successfully?"); }}