Skip to content
This repository was archived by the owner on Oct 22, 2023. It is now read-only.

Commit b1ffda6

Browse files
committed
UnityIntegration
1 parent b1e4e4d commit b1ffda6

File tree

6 files changed

+5
-5
lines changed

6 files changed

+5
-5
lines changed
0 Bytes
Binary file not shown.
-16 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
4 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

Unity/Assets/Scripts/RTSNetworkedSimulation.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,26 @@ public class RTSNetworkedSimulation : MonoBehaviour
2424

2525
private bool _simulationStarted;
2626
private LockstepSystems _systems;
27-
private NetworkedDataSource _dataSource;
27+
private NetworkedDataReceiver _dataReceiver;
2828

2929
private void Awake()
3030
{
3131
Instance = this;
32-
_dataSource = new NetworkedDataSource(_client)
32+
_dataReceiver = new NetworkedDataReceiver(_client)
3333
.RegisterCommand(() => new SpawnCommand())
3434
.RegisterCommand(() => new NavigateCommand());
3535

3636
_systems = new LockstepSystems(Contexts.sharedInstance, new UnityGameService(EntityDatabase),
3737
new UnityLogger());
3838

3939
_simulation =
40-
new Simulation(_systems, _dataSource);
40+
new Simulation(_systems, _dataReceiver);
4141

4242

4343
_simulation.Started += (sender, args) => _simulationStarted = true;
44-
_simulation.Ticked += (id, frame) =>
44+
_simulation.Ticked += id =>
4545
{
46-
_dataSource.Receive(MessageTag.HashCode, new HashCode {FrameNumber = id, Value = Contexts.sharedInstance.gameState.hashCode.value});
46+
_dataReceiver.Receive(MessageTag.HashCode, new HashCode {FrameNumber = id, Value = _systems.HashCode});
4747
};
4848
}
4949

0 commit comments

Comments
 (0)