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 UnityEngine.Analytics;
using System;

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); } }

정적 변수

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

sessionStateChangedDispatched when the Analytics session state changes.

델리게이트

SessionStateChangedDispatched when the Analytics session state changes.