Example #1
0
    void Start()
    {
        //creat each event
        QuestEvent a = quest.AddQuestEvent("test1", "desc1");
        QuestEvent b = quest.AddQuestEvent("test2", "desc2");
        QuestEvent c = quest.AddQuestEvent("test3", "desc3");
        QuestEvent d = quest.AddQuestEvent("test4", "desc4");
        QuestEvent e = quest.AddQuestEvent("test5", "desc5");

        //define the paths between the events
        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());
        QuestButton button = CreatButton(a).GetComponent <QuestButton>();

        button = CreatButton(b).GetComponent <QuestButton>();
        button = CreatButton(c).GetComponent <QuestButton>();
        button = CreatButton(d).GetComponent <QuestButton>();
        button = CreatButton(e).GetComponent <QuestButton>();
        quest.PrintPath();
    }
    void Start()
    {
        QuestEvent a = quest.AddQuestEvent("quest 1", "Find goods", quest1);
        QuestEvent b = quest.AddQuestEvent("quest 2", "Find lost Goods", quest2);

        quest.AddPath(a.GetId(), b.GetId());



        quest.BFS(a.GetId());

        QuestButton button = CreateButton(a).GetComponent <QuestButton>();

        quest1.GetComponent <QuestLocation>().Setup(this, a, button);
        button = CreateButton(b).GetComponent <QuestButton>();
        quest2.GetComponent <QuestLocation>().Setup(this, b, button);

        teleport = a;
        final    = b;

        quest.PrintPath();

        if (!isQuestManagerPresent)
        {
            isQuestManagerPresent = true;
        }
        else
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
Example #3
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);
        }
    }
Example #4
0
    // Start is called before the first frame update
    void Start()
    {
        QuestEvent a  = quest.AddQuestEvent("Check the radio", "The radio seems to making buzzing noises...", A);
        QuestEvent b  = quest.AddQuestEvent("Get the keys", "Look for the car keys under the sofa cushions...", B);
        QuestEvent c  = quest.AddQuestEvent("Start the car", "", C);
        QuestEvent d  = quest.AddQuestEvent("Look for a battery", "Abe keeps some spare vehicles in the back...", D);
        QuestEvent e  = quest.AddQuestEvent("Try the new battery", "", E);
        QuestEvent f  = quest.AddQuestEvent("Radio Abe", "Abe may be able to help...", F);
        QuestEvent g  = quest.AddQuestEvent("Scout the area", "Make sure areas like the outhouse are clear of zombies...", G);
        QuestEvent ga = quest.AddQuestEvent("Wait for Abe", "Don't get bit. Check in with Abe later...", GA, 45f, startEvent);
        QuestEvent h  = quest.AddQuestEvent("Check the satellite dish", "Abe mentioned a radio station down the road...", H, 0f, stopEvent);
        QuestEvent i  = quest.AddQuestEvent("Look for a distraction", "Find something that will draw the zombies away...", I, 0f, disableCollider);
        QuestEvent j  = quest.AddQuestEvent("Light the fireworks", "", J);
        QuestEvent k  = quest.AddQuestEvent("Fix the satellite dish", "The electronics may need to be reset...", K, 0f, enableAction);
        QuestEvent l  = quest.AddQuestEvent("Radio Abe", "Find out how to escape...", L);
        QuestEvent m  = quest.AddQuestEvent("Get the boat keys", "They are probably under the couch cushions...", M, 0f, finalFight);
        QuestEvent n  = quest.AddQuestEvent("Ride into the sunset", "Escape the zombie horde on Abe's boat...", N, 0f, stopEvent);

        quest.AddPath(a.GetId(), b.GetId());
        quest.AddPath(b.GetId(), c.GetId());
        quest.AddPath(c.GetId(), d.GetId());
        quest.AddPath(d.GetId(), e.GetId());
        quest.AddPath(e.GetId(), f.GetId());
        quest.AddPath(f.GetId(), g.GetId());
        quest.AddPath(g.GetId(), ga.GetId());
        quest.AddPath(ga.GetId(), h.GetId());
        quest.AddPath(h.GetId(), i.GetId());
        quest.AddPath(i.GetId(), j.GetId());
        quest.AddPath(j.GetId(), k.GetId());
        quest.AddPath(k.GetId(), l.GetId());
        quest.AddPath(l.GetId(), m.GetId());
        quest.AddPath(m.GetId(), n.GetId());

        quest.BreadthFirstSearch(l.GetId());

        QuestButton button = CreateButton(a).GetComponent <QuestButton>();

        A.GetComponent <QuestLocation>().Setup(this, a, button);
        button = CreateButton(b).GetComponent <QuestButton>();
        B.GetComponent <QuestLocation>().Setup(this, b, button);
        button = CreateButton(c).GetComponent <QuestButton>();
        C.GetComponent <QuestLocation>().Setup(this, c, button);
        button = CreateButton(d).GetComponent <QuestButton>();
        D.GetComponent <QuestLocation>().Setup(this, d, button);
        button = CreateButton(e).GetComponent <QuestButton>();
        E.GetComponent <QuestLocation>().Setup(this, e, button);
        button = CreateButton(f).GetComponent <QuestButton>();
        F.GetComponent <QuestLocation>().Setup(this, f, button);
        button = CreateButton(g).GetComponent <QuestButton>();
        G.GetComponent <QuestLocation>().Setup(this, g, button);
        button = CreateButton(ga).GetComponent <QuestButton>();
        GA.GetComponent <QuestLocation>().Setup(this, ga, button);
        button = CreateButton(h).GetComponent <QuestButton>();
        H.GetComponent <QuestLocation>().Setup(this, h, button);
        button = CreateButton(i).GetComponent <QuestButton>();
        I.GetComponent <QuestLocation>().Setup(this, i, button);
        button = CreateButton(j).GetComponent <QuestButton>();
        J.GetComponent <QuestLocation>().Setup(this, j, button);
        button = CreateButton(k).GetComponent <QuestButton>();
        K.GetComponent <QuestLocation>().Setup(this, k, button);
        button = CreateButton(l).GetComponent <QuestButton>();
        L.GetComponent <QuestLocation>().Setup(this, l, button);
        button = CreateButton(m).GetComponent <QuestButton>();
        M.GetComponent <QuestLocation>().Setup(this, m, button);
        button = CreateButton(n).GetComponent <QuestButton>();
        N.GetComponent <QuestLocation>().Setup(this, n, button);

        endQuest = n;
    }