I have a public class, PerkClass, which has the parameters: name (String), icon (Texture2D), … and script(MonoScript).
`public class PerkClass{
public var name : String;
public var description : String;
public var icon : Texture2D;
public var pointCost : int;
public var script : MonoScript;
public var id : int;
public var perkType : PerkType;
enum PerkType{Melee, Ranged, Magic, Defense, Favor}
public var rarity : Rarity;
enum Rarity{Common, Uncommon, Rare, Epic}
}`
This compiles fine and I can create an array of PerkClass objects in which I can drag javascripts into the script parameter through the inspector.
However, when I build the project, I get the following error:
I have browsed several similar questions but did not find anything useful. I tried changing the parameter type to MonoBehaviour since MonoScript is a polymorph of the MonoBehaviour class, but then I could not drag scripts into the ‘script’ parameter or add them through code.
Any and all help is greatly appreciated!