예제 #1
0
 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);
             }
         }
     }
 }
예제 #2
0
    public override void ApplyEffect()
    {
        if (GetComponents <FireEffectBehaviour>().Length > 1)
        {
            Destroy(this);
        }

        target = GetComponent <BaseCreep>();
        if (target == null)
        {
            Destroy(this);
        }
        this.isActive = true;
    }
예제 #3
0
    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);
        }
    }
예제 #4
0
 public BaseWave(int CreepCount, BaseCreep CreepType)
 {
     this.CreepCount = CreepCount;
     this.CreepType  = CreepType;
 }