public override void AfterPostprocess(MyDefinitionSet set, Dictionary <MyStringHash, MyDefinitionBase> definitions)
 {
     foreach (var def in definitions.Values.Cast <MyPhysicalModelDefinition>())
     {
         def.PhysicalMaterial = MyDestructionData.GetPhysicalMaterial(def, def.m_material);
     }
 }
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);

            var ob = builder as MyObjectBuilder_PhysicalModelDefinition;

            MyDebug.AssertDebug(ob != null);

            this.Model            = ob.Model;
            this.PhysicalMaterial = MyDestructionData.GetPhysicalMaterial(this, ob.PhysicalMaterial);
            this.Mass             = ob.Mass;
        }
Example #3
0
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);
            MyObjectBuilder_PhysicalModelDefinition definition = builder as MyObjectBuilder_PhysicalModelDefinition;

            this.Model = definition.Model;
            if ((base.GetType() == typeof(MyCubeBlockDefinition)) || base.GetType().IsSubclassOf(typeof(MyCubeBlockDefinition)))
            {
                this.PhysicalMaterial = MyDestructionData.GetPhysicalMaterial(this, definition.PhysicalMaterial);
            }
            else
            {
                this.m_material = definition.PhysicalMaterial;
            }
            this.Mass = definition.Mass;
        }
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);

            var ob = builder as MyObjectBuilder_PhysicalModelDefinition;

            MyDebug.AssertDebug(ob != null);

            this.Model = ob.Model;
            if (GetType() == typeof(MyCubeBlockDefinition) || GetType().IsSubclassOf(typeof(MyCubeBlockDefinition)))
            {
                this.PhysicalMaterial = MyDestructionData.GetPhysicalMaterial(this, ob.PhysicalMaterial);
            }
            else
            {
                m_material = ob.PhysicalMaterial;
            }
            this.Mass = ob.Mass;
        }