Version: 2023.2
언어: 한국어

AnalyticsSessionInfo

class in UnityEngine.Analytics

매뉴얼로 전환

설명

Provides access to the Analytics session information for the current game instance.

This class contains static methods for looking up Analytics session information. Note that cumulative statistics are reset if the player re-installs the game.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;

#if ENABLE_CLOUD_SERVICES_ANALYTICS using UnityEngine.Analytics;

public class NewBehaviourScript : MonoBehaviour { void Start() { Debug.Log("Start " + AnalyticsSessionInfo.userId + " " + AnalyticsSessionInfo.sessionState + " " + AnalyticsSessionInfo.sessionId + " " + AnalyticsSessionInfo.sessionElapsedTime); AnalyticsSessionInfo.sessionStateChanged += OnSessionStateChanged; }

void OnSessionStateChanged(AnalyticsSessionState sessionState, long sessionId, long sessionElapsedTime, bool sessionChanged) { Debug.Log("Call " + AnalyticsSessionInfo.userId + " " + sessionState + " " + sessionId + " " + sessionElapsedTime + " " + sessionChanged); } } #endif

정적 변수

customDeviceIdReports the current custom device ID.
customUserIdReports the current custom user ID.
identityTokenThe current user identity token that the Analytics server returns based on AnalyticsSessionInfo.userId.
sessionCountThe number of sessions played since the app was installed.
sessionElapsedTimeThe time elapsed, in milliseconds, since the beginning of the current game session.
sessionFirstRunReports whether the current session is the first session since the player installed the game or application.
sessionIdA random, unique GUID identifying the current game or app session.
sessionStateThe current state of the session.
userIdA random GUID uniquely identifying sessions played on the same instance of your game or app.

Events

identityTokenChangedDispatched when AnalyticsSessionInfo.identityToken is updated by the server.
sessionStateChangedDispatched when the Analytics session state changes.

델리게이트

IdentityTokenChangedDefines the delegate signature to handle AnalyticsSettings.IdentityTokenChanged events.
SessionStateChangedDispatched when the Analytics session state changes.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961