Beispiel #1
0
    public void Setup(QuestManager qm, QuestEvent qe, QustButton qb)
    {
        qManager = qm;
        qEvent   = qe;
        qButton  = qb;

        // setup link between event and button
        qe.button = qButton;
    }
Beispiel #2
0
    void Start()
    {
        if ((string)PhotonNetwork.LocalPlayer.CustomProperties["MissionComplete"] == "NO")
        {
            //create each event
            QuestEvent a = quest.AddQuestEvent("test1", "description 1", A);
            QuestEvent b = quest.AddQuestEvent("test2", "description 2", B);
            QuestEvent c = quest.AddQuestEvent("test3", "description 3", C);
            QuestEvent d = quest.AddQuestEvent("test4", "description 4", D);
            QuestEvent e = quest.AddQuestEvent("test5", "description 5", E);

            // define the paths between the events - e.g. the order they must be completed
            quest.AddPath(a.GetId(), b.GetId());
            quest.AddPath(b.GetId(), c.GetId());
            quest.AddPath(b.GetId(), d.GetId());
            quest.AddPath(c.GetId(), e.GetId());
            quest.AddPath(d.GetId(), e.GetId());

            quest.BFS(a.GetId());

            QustButton button = CreateButton(a).GetComponent <QustButton>();
            A.GetComponent <QuestLocation>().Setup(this, a, button);
            button = CreateButton(b).GetComponent <QustButton>();
            B.GetComponent <QuestLocation>().Setup(this, b, button);
            button = CreateButton(c).GetComponent <QustButton>();
            C.GetComponent <QuestLocation>().Setup(this, c, button);
            button = CreateButton(d).GetComponent <QustButton>();
            D.GetComponent <QuestLocation>().Setup(this, d, button);
            button = CreateButton(e).GetComponent <QustButton>();
            E.GetComponent <QuestLocation>().Setup(this, e, button);

            final = e;

            quest.PrintPath();
        }

        if ((string)PhotonNetwork.LocalPlayer.CustomProperties["MissionComplete"] == "YES")
        {
            compass.GetComponent <CompassController>().enabled = false;
            compassNeedle.SetActive(false);
            victoryPopup.SetActive(true);
        }
    }