private void CreateLayer(LayersChunkData layerChunk) { var layerObj = Instantiate(_layerPrefab, _layersParent); layerObj.transform.localPosition = new Vector3(0.0f, _currentLayerPosition, 0.0f); PlatformLayerLogic logic = layerObj.GetComponent <PlatformLayerLogic>(); logic.Initialize(this, layerChunk, _lastInstantiatedLayer); if (_layerInstances.Count == 0) { _initialPlatform.Initialize(logic); } _layerInstances.Add(logic); _currentLayerPosition += 2.0f; _lastInstantiatedLayer++; }