예제 #1
0
    public bool AddPuzzle(Puzzle puzzle)
    {
        // Create CategoryComponent
        PuzzleComponent.Create(puzzle, transform);

        return(true);
    }
예제 #2
0
    private void CreateCategory(Transform parenTransform)
    {
        // Get category ID
        var categoryComponent = parenTransform.GetComponent <CategoryComponent>();
        int?categoryID        = categoryComponent != null ? (int?)categoryComponent.CategoryData.ID : null;

        // Find all subCategories
        var subCategories = _Categories.Where(c => c.ParentID == categoryID);

        // Create category components
        foreach (Category subCategory in subCategories)
        {
            CreateCategory(CategoryComponent.Create(subCategory, parenTransform));
        }

        // Find all puzzles
        var puzzles = _puzzles.Where(p => p.CategoryID == categoryID);

        // Create puzzle components
        foreach (var puzzle in puzzles)
        {
            PuzzleComponent.Create(puzzle, parenTransform);
        }
    }