public void Execute(int i)
        {
            var snapshot = snapshotFromEntity[entities[i]];

            bool selfSpawn = playerIds.Length > 0 && (snapshot[0].GetPlayerIdComponentDataPlayerId() == playerIds[0].Value);

            if (selfSpawn)
            {
                shipStateFromEntity[entities[i]] = new ShipStateComponentData
                {
                    State = 0
                };
                var state = commandTargetFromEntity[playerEntities[0]];
                state.targetEntity = entities[i];
                commandTargetFromEntity[playerEntities[0]] = state;
            }
            commandBuffer.AddComponent(i, entities[i], new GhostShipState());
        }
        public void Execute(int i)
        {
            emitterFromEntity[entities[i]] = emitterData;
            var snapshot = snapshotFromEntity[entities[i]];

            bool selfSpawn = playerIds.Length > 0 && (snapshot[0].GetPlayerIdComponentDataPlayerId() == playerIds[0].Value);

            if (selfSpawn)
            {
                shipStateFromEntity[entities[i]] = new ShipStateComponentData
                {
                    IsLocalPlayer = 1,
                    State         = 0
                };
                var state = commandTargetFromEntity[playerEntities[0]];
                state.targetEntity = entities[i];
                commandTargetFromEntity[playerEntities[0]] = state;
            }
        }
示例#3
0
        public void Execute(int i)
        {
            emitterFromEntity[entities[i]] = emitterData;
            var snapshot = snapshotFromEntity[entities[i]];

            bool selfSpawn = playerIds.Length > 0 && (snapshot[0].playerId == playerIds[0].Value);

            if (selfSpawn)
            {
                shipStateFromEntity[entities[i]] = new ShipStateComponentData
                {
                    IsLocalPlayer = 1,
                    State         = 0
                };
                var state = playerStateFromEntity[playerEntities[0]];
                state.PlayerShip = entities[i];
                playerStateFromEntity[playerEntities[0]] = state;
            }
        }