public void ShowDamageText(int amount, Vector3 position) { DamageText t = GameObject.Instantiate(damagePrefab); t.transform.position = position + Vector3.back * 5; t.SetValue(amount); }
public static void CreateDamageText(string value, Transform location) { DamageText instance = Instantiate(damageTextPrefab); Vector2 screenPosition = Camera.main.WorldToScreenPoint(location.position); instance.transform.SetParent(canvas.transform, false); instance.transform.position = screenPosition; instance.SetValue(value); }
public static void SpawnDamageText(Character character, uint amount, bool isHealing) { DamageText text = Instantiate(staticTextPrefab, canvas) as DamageText; text.SetCamera(staticMainCamera); text.SetCharacter(character); text.SetValue(amount); if (isHealing) { text.IsHealing(); } else { character.AnimateCharacter(Character.CharacterPoses.Damaged); } }
public void Spawn(float damageAmount) { DamageText instance = Instantiate <DamageText>(damageTextPrefab, transform); instance.SetValue(damageAmount); }