コード例 #1
0
    public void LevelUp()
    {
        StartCoroutine(chatBoxCall.ChatBoxOpener("강해진 기분이 드는데?"));

        ++level;
        exp    = (exp - maxExp);
        maxExp = (maxExp * level);  // 이부분은 나중에.. 레벨별로 나눠서 경험치 부과

        hpIncresase._MaxHp += 10;

        float increasedHp = hpIncresase._MaxHp - hpIncresase._hp;

        hpIncresase._hp = hpIncresase._MaxHp;
        maxHpIncrease.HpUp(increasedHp);

        mpIncrease.maxMp += 1;
        float increasedMp = mpIncrease.maxMp - mpIncrease.nowMp;

        Debug.Log(mpIncrease.maxMp + "최대엠피" + mpIncrease.nowMp + "지금엠피");
        mpIncrease.nowMp = mpIncrease.maxMp; // 레벨업보상
        maxHpIncrease.MpUp(increasedMp);     // 레벨업보상으로 마나채워줌


        //      maxHpIncrease.maxhP += 10;


        Debug.Log(level + "되었음");
    }
    public override void ItemUse(int i)
    {
        if (ItemBagList.itemBagStuffList[i].ItemQttProp >= 1)
        {
            PortionFxGen fxGen = GameObject.Find("Player").GetComponent <PortionFxGen>();
            fxGen.PortionFxGener(0);
            ChatBoxController chatCon = GameObject.Find("Player").GetComponent <ChatBoxController>();
            chatCon.StartCoroutine(chatCon.ChatBoxOpener("포션기모찌\n인정?"));

            PlayerAudioSource polyPlay = GameObject.Find("Player").GetComponent <PlayerAudioSource>();
            polyPlay.playPoly(7);

            float dotHealRate = hpUp._MaxHp / 100;
            if (hpUp._hp > hpUp._MaxHp)
            {
                //                hpUp._hp = hpUp._MaxHp;
                hpGageUP.HpUp(1);   // 그냥 1을 넣어주면 알아서 메소드에서 맞춰줌
                                    //     yield break; 멈출필요는 없는듯 걍 만피만 유지해주면됨 만피에서 떨어지면 이하가실행
            }
            hpUp._hp = hpUp._hp + (dotHealRate * 30);
            hpGageUP.HpUp(0.3f);



            ItemBagList.itemBagStuffList[i].ItemQttProp = ItemBagList.itemBagStuffList[i].ItemQttProp - 1;


            if (ItemBagList.itemBagStuffList[i].ItemQttProp == 0)
            {
                ItemBagList.itemBagStuffList.Remove(ItemBagList.itemBagStuffList[i]);
            }
        }

        methodCaller.WhatIsInBag();

        // 생각좀해보자
    }