Пример #1
0
    public static DamageText Create(Vector3 position, int damage, bool friendly)
    {
        GameObject damageTextObject = Instantiate(Map.Instance.DamageTextPF, position + new Vector3(0, 0.8f, 0), Quaternion.identity);
        DamageText damageText       = damageTextObject.GetComponent <DamageText>();

        damageText.Setup(damage, friendly);
        return(damageText);
    }
Пример #2
0
    public static DamageText Create(Vector3 position, int damageAmount)
    {
        Transform  damageTextTransform = Instantiate(GameAssets.i.pfDamageText, position, Quaternion.identity);
        DamageText damageText          = damageTextTransform.GetComponent <DamageText>();

        damageText.Setup(damageAmount);

        return(damageText);
    }
Пример #3
0
    public void Create(Vector3 position, int damage, bool friendly, Transform target = null)
    {
        DamageText damageText = GameObjectPool.Take(floatingTextPrototype, position, Quaternion.identity);

        damageText.target   = target;
        damageText.oldPos   = position;
        damageText.flyLenth = 0.0f;
        damageText.Setup(damage, friendly);
        activeTexts.Add(damageText);
    }