public void Start() { blockSpawner = GetComponent <IBlockSpawner>(); resource_to_block = new Dictionary <string, Block>(); foreach (Block b in blockPrefabList) { if (resource_to_block.ContainsKey(b.resource_id)) { Debug.LogError("Multiple blocks in same position detached at position" + b.resource_id); } resource_to_block[b.resource_id] = b; } //Map blocks to position List <Block> blocks = blockSpawner.SpawnBlocks(); blockList = new Dictionary <Vector3, Block>(); foreach (Block b in blocks) { if (blockList.ContainsKey(b.transform.position)) { Debug.LogError("Multiple blocks in same position detached at position" + b.transform.position); } blockList[b.transform.position] = b; } }
public GameManager(IBall ball, IPlayer player, IBlockSpawner blockSpawner) { this.ball = ball; this.player = player; this.blockSpawner = blockSpawner; }