예제 #1
0
 // 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);
         }
     }
 }
예제 #2
0
    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);
            }
        }
    }