Exemplo n.º 1
0
    public void SpawnChildren(PatternElement prefab, PatternObject pattern)
    {
        System.Action <Vector2> spawnChildDelegate = x =>
        {
            PatternElement instance = Instantiate(prefab);
            instance.transform.position = Utility.ScaleToOrthographicVector(x);
            instance.AssignStartingPosition(x);
            instance.name = $"Pattern ({pattern.Elements.Count})";

            pattern.AddElement(instance);
        };

        DoSpawnChildren(spawnChildDelegate);
    }