void Start() { puzzlePrefabs.ForEach(p => { var puzzleComponent = p.GetComponent <IPuzzle>(); puzzleManager.Add(puzzleComponent); puzzleComponent.Failure += OnPuzzleFailure; quadrantManager.Add(p); }); quadrantManager.Distribute(); }
void Start() { puzzlePrefabs.ForEach(p => { var puzzle = Instantiate(p); puzzleManager.Add(puzzle.GetComponent <IPuzzle>()); puzzle.GetComponent <IPuzzle>().Failure += OnPuzzleFailure; quadrantManager.Add(puzzle); }); artPrefabs.ForEach(a => { quadrantManager.Add(Instantiate(a)); }); quadrantManager.Distribute(); }