/** * @brief Generates a new instance based on a given seed. **/ public static FPRandom New(int seed) { FPRandom r = new FPRandom(seed); StateTracker.AddTracking(r, "mt"); StateTracker.AddTracking(r, "mti"); return(r); }
void Awake() { FrameSyncConfig currentConfig = ActiveConfig; lockedTimeStep = currentConfig.lockedTimeStep; StateTracker.Init(currentConfig.rollbackWindow); // TODO: 随机数种子在这里指定,需要修改为由 Server 统一指定 FPRandom.Init(); if (currentConfig.physics2DEnabled || currentConfig.physics3DEnabled) { PhysicsManager.New(currentConfig); PhysicsManager.instance.LockedTimeStep = lockedTimeStep; PhysicsManager.instance.Init(); } StateTracker.AddTracking(this, "time"); }
internal static void Init() { instance = New(1); }