private void spawnBoardObject() { GameObject BoardObjectPrefab = Resources.Load <GameObject>(_spawnType); if (BoardObjectPrefab != null) { GameObject spawnedObject = Instantiate(BoardObjectPrefab); if (spawnedObject != null) { Block boardObject = spawnedObject.GetComponent <Block>(); if (boardObject != null) { boardObject.Init(ColorUtil.PickRandom(MyBoard.NumColors), TileLayer); MyBoard.AddBoardObject(boardObject, X, Y, false); boardObject.transform.position = transform.position; boardObject.transform.localScale = Vector3.zero; LeanTween.scale(boardObject.gameObject, Vector3.one, 0.25f).setEase(LeanTweenType.easeOutSine); } } } }