// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>(); Dead = false; Prepped = false; //I don't understand why default value doesn't work. EnemyStats = new GeneralUse.Stats(5, 50); }
void Start() { healthMeters = new GameObject[5]; healthMeters = GameObject.FindGameObjectsWithTag("PlayerHealth"); playerAnims = GetComponentInChildren <Animator>(); currentHeart = healthMeters.GetEnumerator(); currentHeart.MoveNext(); //onFloor = true; //Hp stat useless now with heart system in place, will could put them in sync and play only half animation depending on hp, but eh hmm. playerStats.hp = 10; playerStats.speedAmp = 100; playerStats.dmg = 4; //Saves initial values, prob better way to make this more modular since using in enemies too, only thing could think of is making them ALL under base class livingThing or something. I could do that. would be best, so I'll keep off doing stats for enemies and just handle spawning and moving first. initPlayerStats = new GeneralUse.Stats(playerStats.hp, playerStats.speedAmp, playerStats.dmg); }