Exemplo n.º 1
0
        void Awake()
        {
            TrueSyncConfig currentConfig = ActiveConfig;

            lockedTimeStep = currentConfig.lockedTimeStep;

            StateTracker.Init();

            if (currentConfig.physics2DEnabled || currentConfig.physics3DEnabled)
            {
                PhysicsManager.New(currentConfig);
                PhysicsManager.instance.LockedTimeStep = lockedTimeStep;
                PhysicsManager.instance.Init();
            }
        }
        void Awake()
        {
            TrueSyncConfig currentConfig = ActiveConfig;
            lockedTimeStep = currentConfig.lockedTimeStep;

            StateTracker.Init(currentConfig.rollbackWindow);
            TSRandom.Init();

            if (currentConfig.physics2DEnabled || currentConfig.physics3DEnabled) {
                PhysicsManager.New(currentConfig);
                PhysicsManager.instance.LockedTimeStep = lockedTimeStep;
                PhysicsManager.instance.Init();
            }

            StateTracker.AddTracking(this, "time");
        }
Exemplo n.º 3
0
        //=================================================================================================================
        void Awake()
        {
            TrueSyncConfig currentConfig = ActiveConfig;

            lockedTimeStep = currentConfig.lockedTimeStep;

            // 初始化状态跟踪
            StateTracker.Init(currentConfig.rollbackWindow);
            // 初始化随机数
            TSRandom.Init(randomseed);

            // 初始化物理管理器
            if (currentConfig.physics2DEnabled || currentConfig.physics3DEnabled)
            {
                PhysicsManager.New(currentConfig);
                PhysicsManager.instance.LockedTimeStep = lockedTimeStep;
                PhysicsManager.instance.Init();
            }
            // 跟踪 时间
            StateTracker.AddTracking(this, "time");
        }