public void creattext(Vector2 pos, string text, SCTTYPE type, bool crit)
    {
        pos.y += 0.09f;
        Text combat = Instantiate(combattextpf, transform).GetComponent <Text>();

        combat.transform.position = pos;

        string operation = string.Empty;

        switch (type)
        {
        case SCTTYPE.DAMAGE:
            operation   += "-";
            combat.color = Color.white;
            break;

        case SCTTYPE.HEAL:
            operation   += "+";
            combat.color = Color.green;
            break;
        }
        combat.text = operation + text;
        if (crit)
        {
            combat.GetComponent <Animator>().SetBool("Crit", crit);
        }
    }
Exemple #2
0
    public void CreateText(Vector2 position, string text, SCTTYPE type)
    {
        Text sct = Instantiate(combatTextPrefab, transform).GetComponent <Text>();

        sct.transform.position = position;

        string before = string.Empty;
        string after  = string.Empty;

        switch (type)
        {
        case SCTTYPE.DAMAGE:
            before    = "-";
            sct.color = Color.red;
            break;

        case SCTTYPE.HEAL:
            before    = "+";
            sct.color = Color.green;
            break;

        case SCTTYPE.XP:
            before    = "+";
            after     = "XP";
            sct.color = Color.yellow;
            break;

        default:
            break;
        }

        sct.text = before + text + after;
    }
Exemple #3
0
    public void CreateText(Vector2 position, string text, SCTTYPE type, bool crit)
    {
        position.y += 0.6f;
        var sct = Instantiate(combatTextPrefab, transform).GetComponent <Text>();

        sct.transform.position = position;
        var operation = string.Empty;

        switch (type)
        {
        case SCTTYPE.DAMAGE:
            sct.color = Color.red;
            break;

        case SCTTYPE.HEAL:
            operation += "+";
            sct.color  = Color.green;
            break;
        }

        sct.text = operation + text;
        if (crit)
        {
            sct.GetComponent <Animator>().SetBool("Crit", crit);
        }
    }
Exemple #4
0
 public void CreateText(Vector2 position, string text, SCTTYPE type, bool crit)
 {
     SCTQueue.Enqueue(new SCTObject()
     {
         Crit = crit, Position = position, Text = text, SCTType = type
     });
 }
    public void CreateText(Vector2 position, string text, SCTTYPE type, bool crit)
    {
        // the amont of offset above the head
        position.y += 1.0f;

        Text sct = Instantiate(combatTextPrefab, transform).GetComponent <Text>();

        sct.transform.position = position;

        string before = string.Empty;
        string after  = string.Empty;

        switch (type)
        {
        case SCTTYPE.DAMAGE:
            before    = "-";
            sct.color = Color.red;
            break;

        case SCTTYPE.HEAL:
            before    = "+";
            sct.color = Color.green;
            break;

        case SCTTYPE.EXP:
            before    = "+";
            after     = "Exp";
            sct.color = Color.yellow;
            break;

        case SCTTYPE.HUNGER:
            before    = "+";
            after     = "hunger";
            sct.color = Color.green;
            break;
        }



        sct.text = before + text + after;

        if (crit)
        {
            sct.GetComponent <Animator>().SetBool("crit", crit);
        }
    }
Exemple #6
0
    public void CreatText(Vector2 position, string text, SCTTYPE type, bool crit)
    {
        position.y += 0.5f;//offset

        Text sct = Instantiate(combatTextPrefab, transform).GetComponent <Text>();

        sct.transform.position = position;

        string operation = string.Empty;

        string before = string.Empty;

        string after = string.Empty;

        switch (type)
        {
        case SCTTYPE.DAMAGE:
            operation = "-";
            sct.color = Color.red;
            break;

        case SCTTYPE.HEAL:
            operation = "+";
            sct.color = Color.green;
            break;

        case SCTTYPE.XP:
            operation = "+";
            after     = " XP";
            sct.color = Color.yellow;
            break;

        default:
            break;
        }

        sct.text = operation + text + after;

        if (crit)
        {
            sct.GetComponent <Animator>().SetBool("Crit", crit);
        }
    }
Exemple #7
0
    /// <summary>
    /// 텍스트를 생성하는 함수
    /// </summary>
    /// <param name="position">생성할 위치</param>
    /// <param name="text">텍스트</param>
    /// <param name="type">어떠한 타입의 텍스트인지</param>
    /// <param name="crit">크리일경우 빨간색</param>
    public void CreateText(Vector2 position, string text, SCTTYPE type, bool crit)
    {
        //플레이어 위치에 알맞게 생성
        position.y += 0.8f;
        Text sct = Instantiate(combatTextPrefab, transform).GetComponent <Text>();

        sct.transform.position = position;

        //숫자 앞의 부호표시
        string before = string.Empty;
        string after  = string.Empty;

        switch (type)
        {
        case SCTTYPE.DAMAGE:
            before    = "-";
            sct.color = Color.red;
            break;

        case SCTTYPE.HEAL:
            before    = "+";
            sct.color = Color.green;
            break;

        case SCTTYPE.XP:
            before    = "+";
            after     = " XP";
            sct.color = Color.yellow;
            break;
        }

        sct.text = before + text + after;

        //크리티컬일시
        if (crit)
        {
            sct.GetComponent <Animator>().SetBool("Crit", crit);
        }
    }