Ok so first let me explain what I have, and then I will explain what I want to do.
So I have this script:
It allows me to create parts, and then set its variables, like name, mass etc
public Part[] partInfo; // I store the info of each part in this array, and then acces it by: partInfo[id of the part I wanna get info about]
[System.Serializable]
public struct Part {
public string partName;
public float mass; //mass of the part
public bool top, bottom, sides; //where other parts can be attached
public Sprite texture; //the sprite-texture of the part
}
Ok so this are the stats that each part has.
Now what I would like to do is add some extra variables to some Parts.
So for example I would have a “Fuel tank” part, and I would need a “Fuel” variable for it, but I would not like to have it on all the other parts.
Is there any way to do this? maybe with some kind of inheritance of struct / class or something?