Пример #1
0
    private void PopulateSectionWithActivityObjects(ILevelSection section, GameObject root)
    {
        var distributor = new FeatureDistributor();

        _objectsInActivity = distributor.PlaceConsumables(_prefabCollection, section.PlayArea.LeftPlayAreaEdge.x, section.PlayArea.RightPlayAreaEdge.x);
        foreach (var consumableScript in _objectsInActivity)
        {
            consumableScript.OnConsume        = ConsumeObject;
            consumableScript.transform.parent = root.transform;
        }
    }
Пример #2
0
        void PopulateSectionWithActivityObjects(ILevelSection section)
        {
            var distributor = new FeatureDistributor();
            var consumables = distributor.PlaceConsumables(_prefabCollection, section.PlayArea.LeftPlayAreaEdge.x, section.PlayArea.RightPlayAreaEdge.x);

            foreach (var consumable in consumables)
            {
                consumable.OnConsume        = ConsumeObject;
                consumable.transform.parent = _root.transform;
                _objectsInActivity.Add(consumable);
            }
        }