Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        for (int i = 0; i < height; i++)
        {
            Instantiate(kraniecPionowy, new Vector3(-42f, 32.5f * i, 0f), Quaternion.identity);

            for (int j = 0; j < width; j++)
            {
                if (i == 0)
                {
                    Instantiate(kraniecPoziomy, new Vector3(62.5f * j, (width - 1) * 32.5f + 29.5f, 0f), Quaternion.identity);
                }

                int randomNumber = Random.Range(0, tablicaMap.Count);

                GameObject buff = Instantiate(tablicaMap[randomNumber], new Vector3(62.5f * j, 32.5f * i, 0f), Quaternion.identity);
                buff.GetComponent <QuestList>().Initialize();

                Questnemager.AddQuests(buff.GetComponent <QuestList>().list);

                if (i == height - 1)
                {
                    Instantiate(kraniecPoziomy, new Vector3(62.5f * j, -27f, 0f), Quaternion.identity);
                }
            }
            Instantiate(kraniecPionowy, new Vector3((width - 1) * 62.5f + 44.5f, 32.5f * i, 0f), Quaternion.identity);
        }
    }
Пример #2
0
    private void Start()
    {
        instance     = this;
        Marks        = new List <GameObject>();
        chosenQuests = new List <Quest>();
        for (int i = 0; i < 3; i++)
        {
            int a = Random.Range(0, questList.Count);
            chosenQuests.Add(questList[a]);


            var buff = Instantiate(questMark);
            buff.GetComponent <QuestMarkScript>().setTarget(questList[a].target);
            Marks.Add(buff);
            questList.RemoveAt(a);
        }
    }