Esempio n. 1
0
    void TranslateQuest(IObjective objective)
    {
        var ID = 0;

        if (objective.GetType() == typeof(BaseQuest))
        {
            foreach (IObjective io in (objective as BaseQuest).Objectives)
            {
                TranslateQuest(io);
            }
        }
        else
        {
            ID = (objective as BaseObjective).targetID;
        }

        if (ID == 0)
        {
            return;
        }

        Debug.Log("ID = " + ID);

        //NEED TO CHANGE THIS APROACH
        if (ID == 22)
        {
            hasProtectTarget = true;
            OM.GetObjectives().Add(QuestTarget.GetComponent <QuestObject>());
            QuestTarget.gameObject.SetActive(true);
            return;
        }

        Transform target = QuestTarget;

        if (target == null)
        {
            target = StaticIngameData.player;
        }

        OM.SpawnMonsters(ID, GetSpawnPoint(ID), target);
    }