Exemple #1
0
    public void Setup(QuestManager qm, QuestEvent qe)
    {
        questManager = qm;
        questEvent   = qe;

        if (defualtAvailable)
        {
            questEvent.UpdateQuestEvent(QuestEvent.EventStatus.NOTTAKEN);
        }
    }
Exemple #2
0
 public void CollectQuest()
 {
     questLog = GameObject.FindGameObjectWithTag("QuestLog");
     if (questEvent.status != QuestEvent.EventStatus.NOTTAKEN)
     {
         return;
     }
     questEvent.UpdateQuestEvent(QuestEvent.EventStatus.CURRENT);
     Instantiate(GameAssets.i.questButton, transform.position, Quaternion.identity).GetComponent <QuestButton>().Setup(questEvent, questLog);
 }
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.tag != "Player")
     {
         return;                                      // if the quest object does not hit player, return
     }
     if (qEvent.status != QuestEvent.EventStatus.CURRENT)
     {
         return;                                                 // if the quest is not the current quest that we are working on, return
     }
     qEvent.UpdateQuestEvent(QuestEvent.EventStatus.DONE);
     qButton.UpdateButton(QuestEvent.EventStatus.DONE);
     qManager.UpdateQuestOnCompletion(qEvent);
 }
Exemple #4
0
    public void HandInQuest()
    {
        if (qEvent.status != QuestEvent.EventStatus.CURRENT)
        {
            return;
        }

        qEvent.UpdateQuestEvent(QuestEvent.EventStatus.DONE);
        qManager.UpdateQuestsOnCompletion(qEvent);

        questLog = GameObject.FindGameObjectWithTag("QuestLog").transform;

        foreach (Transform child in questLog)
        {
            QuestButton questButtonScript = child.GetComponent <QuestButton>();
            if (questButtonScript.thisEvent.name == qEvent.name)
            {
                questButtonScript.DestroyButton();
                return;
            }
        }
    }
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.tag != "Player")
        {
            return;
        }

        if (collision.gameObject.GetComponent <PhotonView>().IsMine)
        {
            // if we shouldn't be working on this event
            // then don't register it as completed
            if (qEvent.status != QuestEvent.EventStatus.CURRENT)
            {
                return;
            }

            // inject these back into the Quest Manager to Update States
            qEvent.UpdateQuestEvent(QuestEvent.EventStatus.DONE);
            qButton.UpdateButton(QuestEvent.EventStatus.DONE);
            qManager.UpdateQuestsOnCompletion(qEvent);
        }
    }