コード例 #1
0
    void Start()
    {
        puzzlePrefabs.ForEach(p =>
        {
            var puzzleComponent = p.GetComponent <IPuzzle>();

            puzzleManager.Add(puzzleComponent);
            puzzleComponent.Failure += OnPuzzleFailure;

            quadrantManager.Add(p);
        });

        quadrantManager.Distribute();
    }
コード例 #2
0
    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();
    }