ProjectStorms.ShipPartDestroy.RepairPart C# (CSharp) Method

RepairPart() public method

Re-enables the part, returns mass and thus restores control to the ship.
public RepairPart ( ShipPart a_part ) : void
a_part ShipPart The part to test
return void
        public void RepairPart(ShipPart a_part)
        {
            // Only repair the part if it is destroyed
            if (IsPartDestroyed(a_part))
            {
                // Make the mass change to the parent
                m_shipTray.shipPartMassAdd += a_part.partMass;

                // Re-enable the part
                a_part.partObject.SetActive(true);

                // Clear the destroyed flag
                ClearPartDestroyFlags(a_part);
            }
        }