Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2015

    Question Unity UI Trouble creating GameBoardTester


    I'm getting an error that doesn't make sense to me. Unity doesn't like my GameBoardTester code. The error it gives me is that:

    Assets/Code/Test/GameBoardTester.cs(18,17): error CS0029: Cannot implicitly convert type `SymbolDatabase[]' to `SymbolDatabase'

    It gives me the same error for GameOptions. But looking at my code it looks like I have everything typed correctly. Here's what I have:

    private SymbolDatabase _symbolDatabase;
    	private GameOptions _gameOptions;
    	private bool _isPlaying;
    	public void Start()
    		//gives functionality of signleton but allows multiple instances
    		_symbolDatabase = GetComponentsInParent<SymbolDatabase>();
    		_gameOptions = GetComponentsInParent<GameOptions>();
    		GameBoard.TilePlaced += GameBoardOnTilePlaced;
    		GameBoard.TileRejected += GameBoardOnTileRejected;
    		GameBoard.AllTilesMatched += GameBoardOnAllTilesMatched;

  2. #2
    Join Date
    Feb 2015
    spelling mistake causing the error:

    _symbolDatabase = GetComponentInParent<SymbolDatabase>();

    instead of
    _symbolDatabase = GetComponentsInParent<SymbolDatabase>();

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts