Example #1
0
    public void Drink()
    {
        AudioManager.Instance.PlayEffect(10);
        switch (m_nType)
        {
        case (int)PortionType.Hp:
            m_PlayerAbility.SetHp(m_PlayerAbility.m_Hp + m_fEffect);

            if (m_PlayerAbility.m_AllHp < m_PlayerAbility.m_Hp)
            {
                m_PlayerAbility.SetHp(m_PlayerAbility.m_AllHp);
            }
            m_UIPlayerState.SetHp();
            break;

        case (int)PortionType.Mp:
            m_PlayerAbility.SetMp(m_PlayerAbility.m_Mp + m_fEffect);

            if (m_PlayerAbility.m_AllMp < m_PlayerAbility.m_Mp)
            {
                m_PlayerAbility.SetMp(m_PlayerAbility.m_AllMp);
            }
            m_UIPlayerState.SetMp();
            break;

        case (int)PortionType.Attack:
            m_PlayerAbility.buff(m_nType, m_fEffect);

            break;

        case (int)PortionType.Defense:
            m_PlayerAbility.buff(m_nType, m_fEffect);

            break;

        default:
            return;
        }
        --m_nCount;
        m_CountTxt.text        = m_nCount.ToString();
        m_InInvenCountTxt.text = m_nCount.ToString();

        if (m_nCount < 1)
        {
            Destroy(gameObject);
            m_InInvenObj.GetComponent <PortionEquipment>().ZeroCount();
        }
    }
Example #2
0
    //죽고 마을로 돌아가는 부분
    public IEnumerator PlayerMoveRevival()
    {
        StartCoroutine(m_DieGrey.Grey());
        m_bRevival = true;
        AudioManager.Instance.PlayEffect(8);
        m_Ani.SetTrigger("Die");
        m_Ani.SetInteger("Skill", 0);
        gameObject.GetComponent <NavMeshAgent>().enabled = false;

        yield return(new WaitForSeconds(6.0f));

        if (SceneMng.m_uIScreen != null)
        {
            SceneMng.m_uIScreen.Execute(2.0f);
        }
        m_DieGrey.m_greyAmount = 0;
        yield return(new WaitForSeconds(0.8f));

        transform.position = m_RevivalPos.position;
        m_Ani.SetTrigger("Idle");
        gameObject.GetComponent <NavMeshAgent>().enabled = true;

        m_PlayerAbility.SetHp((int)(m_PlayerAbility.m_AllHp * 0.5f));
        m_PlayerAbility.SetMp((int)(m_PlayerAbility.m_AllMp * 0.5f));

        m_joyStickAttack.m_UIPlayerState.SetHp();
        m_joyStickAttack.m_UIPlayerState.SetMp();

        m_Bodybounds.center = m_Pivot.transform.position;
        actionType          = ActionType.Idle;
        m_bRevival          = false;
    }