Esempio n. 1
0
 internal void InvokeFrameSyncDataInitialize(FrameSyncGame game)
 {
     foreach (IFrameSyncData frameSyncData in _frameSyncDatas)
     {
         frameSyncData.FrameSyncDataInitialize(game);
     }
 }
Esempio n. 2
0
 public override void Update(FrameSyncGame game, FrameSyncInput input, FrameSyncUpdateType updateType)
 {
     foreach (var pair in _behaviours)
     {
         StaticFrameSyncBehaviour behaviour = pair.Value;
         if (!behaviour._isInitialized)
         {
             behaviour.InvokeFrameSyncDataInitialize(game);
         }
         behaviour.InvokeFrameSyncFixedUpdate(input, updateType);
     }
 }
Esempio n. 3
0
        private void Awake()
        {
            _engine = new FrameSyncEngine();

            OnFrameSyncEngineCreated(_engine);

            _engine.SetInputSaveHandler(SaveInput);

            _game = new FrameSyncGame(_engine._input);
            OnFrameSyncGameCreated(_game, null);

            OnFrameSyncGameWillStart();

            StartGame();
        }
Esempio n. 4
0
        public override void Update(FrameSyncGame game, FrameSyncInput input, FrameSyncUpdateType updateType)
        {
            foreach (var pair in _behaviours)
            {
                DynamicFrameSyncBehaviour behaviour = pair.Value;

                if (behaviour.hasBufferedToRemove)
                {
                    continue;
                }

                if (!behaviour._isInitialized)
                {
                    behaviour.InvokeFrameSyncDataInitialize(game);
                }

                behaviour.InvokeFrameSyncFixedUpdate(input, updateType);
            }

            foreach (DynamicFrameSyncBehaviour behaviour in _bufferedNewBehaviours)
            {
                if (!behaviour._isInitialized)
                {
                    behaviour.InvokeFrameSyncDataInitialize(game);
                }
                behaviour.InvokeFrameSyncFixedUpdate(input, updateType);

                _behaviours.Add(behaviour.FrameSyncBehaviourID, behaviour);
            }

            foreach (DynamicFrameSyncBehaviour behaviour in _bufferedRemovedBehaviours)
            {
                Remove(behaviour);
            }

            _bufferedNewBehaviours.Clear();
            _bufferedRemovedBehaviours.Clear();
        }
Esempio n. 5
0
 internal void SetFrameSyncGame(FrameSyncGame game)
 {
     _game = game;
 }
Esempio n. 6
0
 public virtual void Update(FrameSyncGame game, FrameSyncInput input, FrameSyncUpdateType updateType)
 {
 }
Esempio n. 7
0
 public abstract void OnCollectLocalPlayerInputs(FrameSyncInput input, FrameSyncGame game);
Esempio n. 8
0
 public abstract void OnFrameSyncGameCreated(FrameSyncGame game, FrameSyncReplay replay);