Пример #1
0
    void Start()
    {
        CellList.CheckEmpty();

        var levelSource = new Level1();

        Map      = levelSource.CreateMap(Game.Ksids);
        Game.Map = Map;

        foreach (var pair in levelSource.Placeables(PrefabsStore))
        {
            pair.Item1.Instantiate(Map, transform, pair.Item2);
        }

        if (PlaceablesRoots != null)
        {
            foreach (var root in PlaceablesRoots)
            {
                if (root.gameObject.activeInHierarchy)
                {
                    foreach (var p in root.GetComponentsInChildren <Placeable>())
                    {
                        p.PlaceToMap(Map);
                    }
                }
            }
        }

        mapCreated = true;
    }