Inheritance: TextEffect
 void GenerateTextDamagePool(int quantity)
 {
     for (int currentObject = 0; currentObject < quantity; currentObject++)
     {
         GameObject instantiatedObject = gameManager.InstantiateObject(textDamagePrefab, transform, 0.0f, 30.0f, 0.0f, 1.0f, 1.0f, 1.0f);
         TextDamage textDamage         = instantiatedObject.GetComponent <TextDamage>();
         textDamage.prefabPools = this;
         textDamage.StartSetup();
         textDamage.enabled = false;
         stackTextDamage.Push(textDamage);
     }
 }
Exemple #2
0
    public void CreateTextDamage(float damageAmount, float locationX, float locationY, bool takingDamage)
    {
        float randLocX = Random.Range(-0.3f, 0.3f);
        float randLocY = Random.Range(-0.3f, 0.3f);

        TextDamage textDamage = gameManager.prefabPools.PopTextDamage();

        if (textDamage != null)
        {
            textDamage.enabled = true;
            textDamage.PopOffStack(damageAmount, locationX + randLocX, locationY + randLocY, takingDamage);
        }
    }