[SerializeField] DamageText m_DamageTextPrefab = null; //Reference to damage text prefab ///////////////////////////// PUBLIC METHODS //////////////////////////////////////////// //Spawns the prefab with the sent value public void SpawnText(float amount) { DamageText instance = Instantiate <DamageText>(m_DamageTextPrefab, transform); instance.SetValue(amount); }
public void Spawn(float damage) { DamageText instance = Instantiate(damageTextPrefab, transform.position, Quaternion.identity); instance.SetValue(damage); }
public void Spawn(float damageAmount) { DamageText instance = Instantiate <DamageText>(damageTextPrefab, transform); instance.SetValue(damageAmount); }