public override void OnSerialize(IComponentSerializer s) { s.Serialize(nameof(movementVector), movementVector); s.Serialize(nameof(movementFactor), movementFactor); s.Serialize(nameof(period), period); s.Serialize(nameof(Node.Position), Node.Position); s.Serialize(nameof(Node.Rotation), Node.Rotation); }
private List <ComponentData> SerializeEntity(TEntity entity, Dictionary <int, Type> actualToSavedIndexes, Dictionary <Type, int> typeToSavedIndex) { var entityData = new List <ComponentData>(entity.totalComponents); var componentIndexes = entity.GetComponentIndices(); var componentIndexesLength = componentIndexes.Length; for (var index = 0; index < componentIndexesLength; index++) { var actualIndex = componentIndexes[index]; if (!actualToSavedIndexes.ContainsKey(actualIndex)) { continue; } if (!typeToSavedIndex.TryGetValue(actualToSavedIndexes[actualIndex], out var savedIndex)) { continue; } entityData.Add(new ComponentData { T = savedIndex, C = _componentSerializer.Serialize(entity.GetComponent(actualIndex)) }); } return(entityData); }
public override void OnSerialize(IComponentSerializer s) { s.Serialize(nameof(Color), Color); }
public override void OnSerialize(IComponentSerializer s) { s.Serialize(nameof(Color), Color); }
public override void OnSerialize(IComponentSerializer s) { s.Serialize(nameof(RotationSpeed), RotationSpeed); s.Serialize(nameof(Node.Position), Node.Position); s.Serialize(nameof(Node.Rotation), Node.Rotation); }