ドキュメント

Unity Engine

Download Unity

Unity Engine

GetNextKey()

Returns the next distributed unique id.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: Unity.Localization
  • Assembly: UnityEngine.LocalizationRuntimeModule
public long GetNextKey()

Returns

Type

Description

longA distributed unique id suitable for a table key.

Remarks

Combines the current timestamp, the DistributedUIDGenerator.MachineId, and a per-millisecond sequence. Every generator in the process shares that sequence, so ids stay unique when the clock moves backwards, when several ids are requested within the same millisecond, and when two generators are asked for a key at the same moment.
Generate a single id.

Examples

using Unity.Localization;using UnityEngine;namespace Unity.Localization.Samples{ public class DistributedUIDGeneratorGetNextKeyExample { public void Run() { var generator = new DistributedUIDGenerator(); long id = generator.GetNextKey(); Debug.Log(id); // a distributed unique id } }}