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.