(Mache nach 2-4h Schlaf weiter. Noch nicht ganz fertig, aufgrund aufgrund mangelnder Zeit durch Arbeit, damaligen privaten Problemen und damals zu viel vorgenommen).
20 lines
433 B
C#
20 lines
433 B
C#
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// Move each layer
|
|
/// Original script: https://pastebin.com/ZniykeGz.
|
|
/// YouTube link: https://youtu.be/MEy-kIGE-lI.
|
|
/// </summary>
|
|
|
|
public class ParallaxLayer : MonoBehaviour
|
|
{
|
|
public float parallaxFactor;
|
|
|
|
public void Move(float delta)
|
|
{
|
|
Vector3 newPos = transform.localPosition;
|
|
newPos.x -= delta * parallaxFactor;
|
|
|
|
transform.localPosition = newPos;
|
|
}
|
|
} |