private async void OnSpawnCubeRequest(CubeSpawner.SpawnCube.ReceivedRequest requestReceived)
        {
            cubeSpawnerCommandRequestHandler.SendSpawnCubeResponse(
                new CubeSpawner.SpawnCube.Response(requestReceived.RequestId, new Empty()));

            var entityReservationSystem = world.GetExistingSystem <EntityReservationSystem>();
            var entityId = await entityReservationSystem.GetAsync();

            SpawnCube(entityId);
        }
Esempio n. 2
0
        private void OnSpawnCubeRequest(CubeSpawner.SpawnCube.ReceivedRequest requestReceived)
        {
            cubeSpawnerCommandRequestHandler.SendSpawnCubeResponse(
                new CubeSpawner.SpawnCube.Response(requestReceived.RequestId, new Empty()));

            var request = new WorldCommands.ReserveEntityIds.Request
            {
                NumberOfEntityIds = 1,
                Context           = this,
            };

            worldCommandRequestSender.SendReserveEntityIdsCommand(request, OnEntityIdsReserved);
        }