コード例 #1
0
    public void OpenQuestWindow()
    {
        PlayerQuest playerQuest = player.GetComponent <PlayerQuest>();

        actUi.nameText.text        = playerQuest.quests[0].name;
        actUi.descriptionText.text = playerQuest.quests[0].description;
        actUi.expText.text         = "Exp Reward : " + playerQuest.quests[0].expReward.ToString() + "exp";
        actUi.goldText.text        = "Gold Reward : " + playerQuest.quests[0].goldReward.ToString() + "gold";
    }
コード例 #2
0
    public void TakeDamage(float damageValue)
    {
        //Get PlayerQuest component into playerQuest(PlayerQuest)
        PlayerQuest playerQuest = player.GetComponent <PlayerQuest>();

        curHp         -= damageValue;
        mySlider.value = curHp / maxHp;
        if (curHp <= 0)
        {
            Die();
        }
        if (curHp <= 0 && playerQuest.quests[0].state == QuestState.Accepted)
        {
            playerQuest.quests[0].goal.EnemyKilled();
            Die();
        }
    }