public void putPowerUpModifier(PowerUpModifier powerUp)
    {
        int id = Random.Range(0, 50);

        powerUpModifiers.Add(id, powerUp);
        StartCoroutine(removePowerUp(id));
    }
Beispiel #2
0
 private bool ChechIfMissingComponents(PowerUpModifier obj)
 {
     if (obj.powerUp == null)
     {
         Debug.LogError("Object to spawn in " + obj.name + " is null"); return(true);
     }
     if (obj.transparentMaterial == null)
     {
         Debug.LogError("Transparent material " + obj.name + " is null"); return(true);
     }
     if (obj.timeOfLife == 0)
     {
         Debug.LogError("Time of life in " + obj.name + " is 0, object is destoryed on the same frame"); return(true);
     }
     if (obj.type == PowerUp.Type.Heal && obj.healAmount == 0)
     {
         Debug.LogError("Heal amount in " + obj.name + " is 0, it won't heal"); return(true);
     }
     if (obj.type == PowerUp.Type.Bomb && obj.radious == 0)
     {
         Debug.LogError("Explosion radious in " + obj.name + " is 0 (I have to put it automatically to 10)"); return(true);
     }
     if (obj.priority == PowerUpModifier.Priority.SpawnAtEnemy && obj.spawnAtEnemyNo == 0)
     {
         Debug.LogError("Spawn at enemy No: in " + obj.name + " is 0, it will never spawn"); return(true);
     }
     return(false);
 }