void GenerateFrontLayer() { Vector3 frontLayerPosition = new Vector3( transform.position.x + (Constants.PARALLAX_BACKGROUD_WIDTH * FrontLayers.Count), 0f, transform.position.z); ParallaxLayerBehaviour frontLayer = Instantiate(FrontLayerGO, frontLayerPosition, Quaternion.identity); FrontLayers.Add(frontLayer); frontLayer.transform.SetParent(transform, true); }
void GenerateBackLayer() { Vector3 backLayerPosition = new Vector3( transform.position.x + (Constants.PARALLAX_BACKGROUD_WIDTH * BackLayers.Count), 0.8f, transform.position.z); ParallaxLayerBehaviour backLayer = Instantiate(BackLayersGO, backLayerPosition, Quaternion.identity); BackLayers.Add(backLayer); backLayer.transform.SetParent(transform, true); }