// Manually scroll the parallax object by x and y distances. public void Scroll(float xdistance, float ydistance) { for (int index = 0; index < m_Layers.Length; ++index) { LayerInfo layer = m_Layers[index]; ParallaxObject script = layer.GetParallaxObject(); if (script != null) { script.Scroll(xdistance, ydistance); } } }
protected void Update() { if (m_Layers == null) { enabled = false; return; } for (int index = 0; index < m_Layers.Length; ++index) { LayerInfo layer = m_Layers[index]; ParallaxObject script = layer.GetParallaxObject(); if (script != null) { script.SetScrollVelocity(m_Velocity); script.SetVerticalScrollVelocity(m_VerticalVelocity); } } }