- Home /
Objects from Custom Classes
I am working on a custom turn based combat system. The whole "turn based" part is done, but I'm struggling a bit with the combat part. Most specifically with making skills. I have made a class for the skills called Skill, which looks like this:
#pragma strict
public class Skill extends MonoBehaviour {
var cost : int[];
var skillName : String;
var element : int;
public function Skill (manaCost : int[], n : String, e :int) {
skillName = n;
cost = manaCost;
element = e;
}
}
My question is, how do I make skills with this to be stored and used by several different GameObjects throughout the game? I would like to just be able to drag and drop skills into the inspector window if possible, and know what to do if it isn't.
Update: By just putting the constructor script on an object, I can now have them in the scene, but is there a way to simply have them in assets? Making a prefab out of the object with the script didn't work
Your answer
Follow this Question
Related Questions
Making an item class in Unity. 1 Answer
Type 'Object' does not support slicing 1 Answer
Disable GameObject Only Father Not Children 2 Answers
How to use corutines in a class 1 Answer
missingGameObject problem 3 Answers