void Update() { if (CreepQueue != null) { if (CreepQueue.Count > 0 && SpawnPool.Count > 0) { //Counts down to spawn SpawnTimer -= Time.deltaTime; if (SpawnTimer <= 0) { //Gets next creep in queue BaseCreep creep = CreepQueue.Dequeue(); //Gets next SpawnPool object GameObject poolObject = SpawnPool.Dequeue(); //Sets object to active poolObject.SetActive(true); //Gets component for creep handling and sets correct creep poolObject.GetComponent<CreepMovementTesting>().CurrentCreep = creep; Debug.Log("Spawning Creep"); //Reset timer SpawnTimer = SpawnDelay; SpawnCounter++; Debug.Log(SpawnCounter); } } } }
public override void ApplyEffect() { if (GetComponents <FireEffectBehaviour>().Length > 1) { Destroy(this); } target = GetComponent <BaseCreep>(); if (target == null) { Destroy(this); } this.isActive = true; }
protected void basicDamage(BaseCreep target, float DamageTimer = 0.0f) { target.Hp -= this.damageAmount; if (this.Effect != null) { this.AddEffect(target.gameObject); } if (hit != null) { hit(this, EventArgs.Empty); } }
public BaseWave(int CreepCount, BaseCreep CreepType) { this.CreepCount = CreepCount; this.CreepType = CreepType; }