Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- [ExecuteInEditMode]
- public class ParallaxLayer : MonoBehaviour
- {
- public float parallaxFactor;
- public void Move(float delta)
- {
- Vector3 newPos = transform.localPosition;
- newPos.x -= delta * parallaxFactor;
- transform.localPosition = newPos;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement