Example #1
0
    void OnDestroy()
    {
        if (boardHolesMask != null)
        {
            Debug.Log("[Match3BoardGameLogic] Destroying the board holes mask texture...");
            Destroy(boardHolesMask);
        }

        if (BoardAnimations != null)
        {
            BoardAnimations.OnTilesSwitchAnimFinished -= OnTilesSwitchAnimFinished;
        }
        Match3Tile.OnTileMovingChanged -= OnTileMovingChanged;

        gameSoundEventsHandler.UnregisterSoundEvents();
        gameSoundEventsHandler = null;

        OnStableBoard -= StableBoardLose;
        OnStableBoard -= StableBoardWin;
        OnStableBoard -= FreeFallFinished;
    }