Esempio n. 1
0
        /**
         *  @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);
        }
Esempio n. 2
0
        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");
        }
Esempio n. 3
0
 internal static void Init()
 {
     instance = New(1);
 }