Esempio n. 1
0
    public void GetQuest(CGameQuestInfo _quest, QusetManager _questManager)
    {
        bIsQuest         = true;
        _quest.bIsActive = true;
        nItemIndex       = _quest.nIndex;                       //index
        questData        = _quest;                              //퀘스트 정보
        questManager     = _questManager;                       //퀘스트 매니저

        textQuestContents.text = questData.strExplain;

        textProgressValue.text = getGold.ToString() + "/" + questData.nCompleteCondition.ToString();
        nCompareCondition      = questData.nCompleteCondition;
        if (questData.nRewardGold != 0)
        {
            textReward.text = questData.nRewardGold.ToString();
        }

        if (questData.nRewardHonor != 0)
        {
            textReward.text = questData.nRewardHonor.ToString();
        }

        if (questData.nRewardBossPotion != 0)
        {
            textReward.text = questData.nRewardBossPotion.ToString();
        }


        sButton = startButton.GetComponent <Button> ();
        sButton.onClick.RemoveListener(() => questManager.CompleteQuest(float.Parse(textReward.text)));
        sButton.onClick.AddListener(() => questManager.CompleteQuest(float.Parse(textReward.text)));
    }
Esempio n. 2
0
    public void GetQuest(CGameQuestInfo _quest, QusetManager _questManager)
    {
        completeButton.SetActive(false);
        bIsQuest = true;
        giveUpButton.onClick.RemoveAllListeners();
        giveUpButton.onClick.AddListener(GiveUpActive);

        Debug.Log("GetQuest!" + bIsQuest);
        //1~5배 만큼 곱해준다
        int randomRange = Random.Range(1, 5);

        nQuestIndex  = _quest.nIndex;                           //index
        questData    = _quest;                                  //퀘스트 정보
        questManager = _questManager;                           //퀘스트 매니저

        textQuestContents.text = questData.strExplain;

        //init
        nCompareCondition  = 0;
        nCompleteCondition = 0;
        nCompleteCondition = questData.nCompleteCondition * randomRange;
        nMutiplyValue      = randomRange;

        questTypeIndex = questManager.ReturnQuestType(nQuestIndex);

        textProgressValue.text = string.Format("{0}", nCompareCondition) + "/" + string.Format("{0}", nCompleteCondition);
        textQuestUpValue.text  = string.Format("{0}", nMutiplyValue) + " pt";

        //Potion
        if (nMutiplyValue >= 3)
        {
            potionImage.enabled = true;
        }

        else
        {
            potionImage.enabled = false;
        }


        //Ruby
        if (nMutiplyValue > 3)
        {
            if (questData.nRewardRuby != 0)
            {
                int getRuby = questData.nRewardRuby * randomRange;
                textReward_Ruby.text = string.Format("{0}", getRuby);
            }
        }
        else
        {
            textReward_Ruby.text = string.Format("{0}", 0);
        }
        if (questData.nRewardHonor != 0)
        {
            int getHonor = questData.nRewardHonor * randomRange;
            textReward_Honor.text = string.Format("{0}", getHonor);
        }
    }
Esempio n. 3
0
    //저장된 데이터 불러올떄
    public void GetQuest(CGameQuestInfo _quest, QusetManager _questManager, int _compareValue, int _multiplyValue)
    {
        bIsQuest = true;
        giveUpButton.onClick.RemoveAllListeners();
        giveUpButton.onClick.AddListener(GiveUpActive);

        nQuestIndex  = _quest.nIndex;                           //index
        questData    = _quest;                                  //퀘스트 정보
        questManager = _questManager;                           //퀘스트 매니저

        textQuestContents.text = questData.strExplain;
        questTypeIndex         = questManager.ReturnQuestType(nQuestIndex);
        nCompareCondition      = _compareValue;
        nCompleteCondition     = 0;
        nCompleteCondition     = questData.nCompleteCondition * _multiplyValue;
        nMutiplyValue          = _multiplyValue;
        //1~5배 만큼 곱해준다
        textProgressValue.text = string.Format("{0}", nCompareCondition) + "/" + string.Format("{0}", nCompleteCondition);
        textQuestUpValue.text  = string.Format("{0}", nMutiplyValue) + " pt";


        //Potion
        if (nMutiplyValue >= 3)
        {
            potionImage.enabled = true;
        }

        else
        {
            potionImage.enabled = false;
        }


        //Ruby
        if (nMutiplyValue > 3)
        {
            if (questData.nRewardRuby != 0)
            {
                int getRuby = questData.nRewardRuby * _multiplyValue;
                textReward_Ruby.text = string.Format("{0}", getRuby);
            }
        }
        else
        {
            textReward_Ruby.text = string.Format("{0}", 0);
        }


        //honor
        if (questData.nRewardHonor != 0)
        {
            int getHonor = questData.nRewardHonor * _multiplyValue;
            textReward_Honor.text = string.Format("{0}", getHonor);
        }
    }