Пример #1
0
    void SpawnItem(TileMapData map)
    {
        int r = (int)Random.Range(0, 4);

        if (r == 0)
        {
            Spawning.SpawnItem(map, Sword);
            GameObject.FindGameObjectWithTag("Equip").GetComponent <Weapon>().setStats(DungeonFloor + 1, DungeonFloor / 2, 0);
        }
        else if (r == 1)
        {
            Spawning.SpawnItem(map, Helmet);
            GameObject.FindGameObjectWithTag("Equip").GetComponent <Helmet>().setStats(DungeonFloor / 2, DungeonFloor + 1, 0);
        }
        else if (r == 2)
        {
            Spawning.SpawnItem(map, Necklace);
            GameObject.FindGameObjectWithTag("Equip").GetComponent <Necklace>().setStats(DungeonFloor + 1, DungeonFloor + 1, DungeonFloor + 1);
        }
        else if (r == 3)
        {
            Spawning.SpawnItem(map, Armor);
            GameObject.FindGameObjectWithTag("Equip").GetComponent <Armor>().setStats(DungeonFloor / 2, 0, DungeonFloor + 1);
        }
    }