public void ApplyPropertiesFromSave(AgentProjectile projectile) { NodeGroupSaveHelper.CopyGroups(this, projectile); TimeToLiveRemaining = projectile.TimeToLiveRemaining; Amount = projectile.Amount; Properties = projectile.Properties; Transform = projectile.Transform; LinearVelocity = projectile.LinearVelocity; AngularVelocity = projectile.AngularVelocity; }
/// <summary> /// A bit on the lighter save properties copying, /// the spawn function used to create this needs to set some stuff beforehand /// </summary> public void ApplyPropertiesFromSave(FloatingChunk chunk) { NodeGroupSaveHelper.CopyGroups(this, chunk); VentPerSecond = chunk.VentPerSecond; Dissolves = chunk.Dissolves; Size = chunk.Size; Damages = chunk.Damages; DeleteOnTouch = chunk.DeleteOnTouch; Mass = chunk.Mass; Radius = chunk.Radius; ChunkScale = chunk.ChunkScale; ContainedCompounds = chunk.ContainedCompounds; Transform = chunk.Transform; LinearVelocity = chunk.LinearVelocity; AngularVelocity = chunk.AngularVelocity; }
protected override void ReadCustomExtraFields(JObject item, object instance, JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { NodeGroupSaveHelper.ReadGroups(item, (Node)instance, reader, serializer); }
protected override void WriteCustomExtraFields(JsonWriter writer, object value, JsonSerializer serializer) { NodeGroupSaveHelper.WriteGroups(writer, (Node)value, serializer); }