Example #1
0
    protected override void Awake()
    {
        Debug.Log("Match3BoardGameLogic Awake");
        instance = this;

        base.Awake();

        waitEndFrame = new WaitForEndOfFrame();

        HOTween.Init(false, false, false);

        characterUsed = CharacterSpecialAnimations.characterIndex < 0 ? "" : CompanionSelect.icons[CharacterSpecialAnimations.characterIndex];

        LoadLevel(Match3BoardRenderer.levelIdx);

        // Once the level is loaded get the reference to the board data
        boardData = boardRenderer.GetComponent <BoardData>();

        gameSoundEventsHandler = new InGameSoundEventsHandler();
        gameSoundEventsHandler.RegisterSoundEvents();
    }
Example #2
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;
    }
	protected override void Awake ()
	{
		Debug.Log("Match3BoardGameLogic Awake");
		instance = this;

		base.Awake ();
		
		waitEndFrame = new WaitForEndOfFrame();
			
		HOTween.Init(false, false, false);
		
		characterUsed = CharacterSpecialAnimations.characterIndex < 0 ? "" : CompanionSelect.icons[CharacterSpecialAnimations.characterIndex];
		
		LoadLevel(Match3BoardRenderer.levelIdx);
		
		// Once the level is loaded get the reference to the board data
		boardData = boardRenderer.GetComponent<BoardData>();
		
		gameSoundEventsHandler = new InGameSoundEventsHandler();
		gameSoundEventsHandler.RegisterSoundEvents();
	}
	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;
	}