Ejemplo n.º 1
0
    public void ShowDamageText(int amount, Vector3 position)
    {
        DamageText t = GameObject.Instantiate(damagePrefab);

        t.transform.position = position + Vector3.back * 5;
        t.SetValue(amount);
    }
Ejemplo n.º 2
0
    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);
    }
Ejemplo n.º 3
0
    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);
        }
    }
Ejemplo n.º 4
0
    public void Spawn(float damageAmount)
    {
        DamageText instance = Instantiate <DamageText>(damageTextPrefab, transform);

        instance.SetValue(damageAmount);
    }