예제 #1
0
    protected override void Awake()
    {
        base.Awake();

        LetterTilePool   = new ObjectPool(letterTilePrefab.gameObject, 16, transform);
        SavedBoardStates = new Dictionary <string, BoardState>();
        CompletedLevels  = new Dictionary <string, bool>();

        // Load any save data
        if (!LoadSave())
        {
            // If there as not save data then set the current hints to the starting hints
            CurrentHints             = startingHints;
            LevelsToCompleteBeforeAd = adLevelCompleteAmount;
            ActiveDailyPuzzleIndex   = -1;
        }

        // Check to make sure that the ActiveCategory and ActiveLevelIndex still exist
        bool exists = false;

        for (int i = 0; i < CategoryInfos.Count; i++)
        {
            if (ActiveCategory == CategoryInfos[i].name)
            {
                exists = ActiveLevelIndex < CategoryInfos[i].levelInfos.Count;
                break;
            }
        }

        if (!exists)
        {
            ActiveCategory   = "";
            ActiveLevelIndex = 0;
        }

        // Initialize all our important things
        letterBoard.Initialize();
        wordGrid.Initialize();

        // Setup events
        letterBoard.OnWordFound += OnWordFound;
    }
예제 #2
0
    protected override void Awake()
    {
        base.Awake();

        LetterTilePool   = new ObjectPool(letterTilePrefab.gameObject, 16, transform);
        SavedBoardStates = new Dictionary <string, BoardState>();
        CompletedLevels  = new Dictionary <string, bool>();

        // Load any save data
        if (!LoadSave())
        {
            // If there as not save data then set the current hints to the starting hints
            CurrentHints           = startingHints;
            ActiveDailyPuzzleIndex = -1;
        }

        // Initialize all our important things
        letterBoard.Initialize();
        wordGrid.Initialize();

        // Setup events
        letterBoard.OnWordFound += OnWordFound;
    }