NPC Class looking for help

So, I’m trying to set up a basic NPC… all it has for stats is current and max health, but I’m not using the scene editor for this project, it’s all in the scripting. So I’m curious as to the most efficient way to do this.

using UnityEngine;
using System.Collections;

public class BasicEnemy {
	GameObject[] basicEnemy;
	
	void Start() {
		basicEnemy += GameObject.CreatePrimitive(PrimitiveType.Cube);
		basicEnemy += GameObject.CreatePrimitive(PrimitiveType.Cube);
		basicEnemy += GameObject.CreatePrimitive(PrimitiveType.Cube);
		basicEnemy += GameObject.CreatePrimitive(PrimitiveType.Cube);
		basicEnemy += GameObject.CreatePrimitive(PrimitiveType.Cube);
		basicEnemy[0].tag = "Mob";
		basicEnemy[1].tag = "Mob";
		basicEnemy[2].tag = "Mob";
		basicEnemy[3].tag = "Mob";
		basicEnemy[4].tag = "Mob";
		
	}
}
	
public enum BasicEnemyStats {
	currentHealth,
	maxHealth
}

my goal is to get a group of enemies that all have the currentHealth and maxHealth stats, while doing this I will use the array to combat NPC’s of a certain type until there are none left. Thus winning the game.

I understand and appreciate that you want to create your mob through scripting, thats awesome! I would recommend however, first creating a single instance of your mob NPC in the editor and testing it out. Attach your custom Mob Monobehaviour script (which has currentHealth and maxHealth public members) to this object, its mesh (or cube), etc, etc. When it’s all nice and working how you like, turn it into a prefab.

A prefab is like a cookie cutter for game objects. You make one, then you can reuse it to create as many copies (clones) as you like in a scene (through scripting).

So you would then make a MobSpawner script (inheriting from Monobehaviour as well) that would instantiate as many copies as are needed. You’d drop this spawner in your scene and let the havoc unfold.

I apologise if this answer is too high-level, please let me know if you could use further clarification.