protected override void Init(MyObjectBuilder_DefinitionBase builder) { base.Init(builder); var ob = builder as MyObjectBuilder_DestructionDefinition; DestructionDamage = ob.DestructionDamage; Icon = ob.Icon; ConvertedFractureIntegrityRatio = ob.ConvertedFractureIntegrityRatio; if (ob.FracturedPieceDefinitions != null && ob.FracturedPieceDefinitions.Length > 0) { FracturedPieceDefinitions = new MyFracturedPieceDefinition[ob.FracturedPieceDefinitions.Length]; for (int i = 0; i < ob.FracturedPieceDefinitions.Length; ++i) { MyFracturedPieceDefinition def = new MyFracturedPieceDefinition(); def.Id = ob.FracturedPieceDefinitions[i].Id; def.Age = ob.FracturedPieceDefinitions[i].Age; FracturedPieceDefinitions[i] = def; } } }
protected override void Init(MyObjectBuilder_DefinitionBase builder) { base.Init(builder); var ob = builder as MyObjectBuilder_DestructionDefinition; DestructionDamage = ob.DestructionDamage; Icons = ob.Icons; ConvertedFractureIntegrityRatio = ob.ConvertedFractureIntegrityRatio; if (ob.FracturedPieceDefinitions != null && ob.FracturedPieceDefinitions.Length > 0) { FracturedPieceDefinitions = new MyFracturedPieceDefinition[ob.FracturedPieceDefinitions.Length]; for (int i = 0; i < ob.FracturedPieceDefinitions.Length; ++i) { MyFracturedPieceDefinition def = new MyFracturedPieceDefinition(); def.Id = ob.FracturedPieceDefinitions[i].Id; def.Age = ob.FracturedPieceDefinitions[i].Age; FracturedPieceDefinitions[i] = def; } } }