Creating something with multiple variables

Im trying to make a script that makes it easier to adds spells to my game. What i need is a inspector variable called “spell”. When i click on this i want to be able to set the damage, type, speed etc of the spell. I have know knowledge of what to do and don’t know how to do it. pop me a message if you know of anything that can help me.

this is what i have up to now.

using System.Collections;

[System.Serializable]
public class Spell : MonoBehaviour {

	public string name;
	public int damage;
}


public class Magic : MonoBehaviour {

	int mp = 1000;

	void Update () {
	

	}

	void MagicAttack(){

		int spellDmg;
		int spellPower;

	}


	void MagicDefence(string t, int dmg, int dot){


	}
}

The question is maybe 2/3s basic programming, and 1/3 Unity extras. For the programming, maybe just skim any programming book that looks good, just to get the concepts.

Class Spell tells the computer what a spell would be, if you had any. It’s like a deer hunting license (you can’t eat or cast it.) The next step is too make (declare) spell variables. Also, MonoBehaviour is only for special scripts that go on objects:

[System.Serializable]
public class Spell { // if you make a spell, it looks like this:
  public string name;
  public int damage;
}

public class SpellBook :  MonoBehaviour {
  public Spell spell1; // make one spell (named spell1)

  public Spell[] Book1; // make a bunch of spells
}

If you drag that script onto a gameObject, the 1st part (almost exactly what you had) tells it what spells are. System.Serializable tells Unity to make slots for the parts, and save what you enter. The other part is the real script that goes on the gameObject (because of the magic Monobehaviour.) spell1 should have both spell parts. Book1 is an array – it you type 6, should see six sets of spell parts appear.