init
This commit is contained in:
commit
8103d0d89d
514 changed files with 211049 additions and 0 deletions
15
Assets/Scripts/Paralax.cs
Normal file
15
Assets/Scripts/Paralax.cs
Normal file
|
@ -0,0 +1,15 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Paralax : MonoBehaviour{
|
||||
|
||||
[SerializeField] GameObject reference;
|
||||
[SerializeField] float scroll;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
Vector2 pos = new Vector2(reference.transform.position.x * scroll, transform.position.y * .05f);
|
||||
transform.position = pos;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue