Exemple #1
0
    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;
    }
Exemple #2
0
    /// <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;
    }
Exemple #3
0
 protected override void ReadCustomExtraFields(JObject item, object instance, JsonReader reader, Type objectType,
                                               object existingValue, JsonSerializer serializer)
 {
     NodeGroupSaveHelper.ReadGroups(item, (Node)instance, reader, serializer);
 }
Exemple #4
0
 protected override void WriteCustomExtraFields(JsonWriter writer, object value, JsonSerializer serializer)
 {
     NodeGroupSaveHelper.WriteGroups(writer, (Node)value, serializer);
 }