Quantcast
Channel: Latest Questions by Kenned
Viewing all articles
Browse latest Browse all 14

Array of abstract class in inspector

$
0
0
Hey people :) I'm kinda new to the whole making custom inspector scripts, but I have this problem that I was wondering if is even solvable. So what I want to do is have multiple classes extending from my Skill class which are all unique, this is not a problem, however I'm looking to be able to attach these to a character through the inspector into an array of Skill. Is that possible and is there a smarter way of doing it? :) I have a class which contains the line of code that looks like this: public Skill[] mySkills = new Skill[8]; And the abstract class Skill which looks like this: public abstract class Skill{ public bool targetMyTeam; public bool targetMustBeEmpty; protected string name; public enum targetPattern{ singleTarget, teamTarget, allTarget, randomTarget, lineTarget, rowTarget, singleTargetFront, lineTargetFront, adjacentTarget, crossTarget, noTarget } protected targetPattern myPattern; public abstract bool Action(BattleParticipant[] target); public abstract void UpdateStat(int neoStat); public abstract string GetName(); public abstract targetPattern GetTargetPattern(); }

Viewing all articles
Browse latest Browse all 14

Trending Articles