Zone View Mousedrag & Background Parallax
This commit is contained in:
parent
4221f304f1
commit
6dd43fc193
9 changed files with 113 additions and 5 deletions
|
|
@ -10,19 +10,19 @@ public class BackgroundRenderer : MonoBehaviour
|
|||
// public float RotationSpeed2 = 1;
|
||||
private Camera _camera;
|
||||
private float _ratio;
|
||||
//private Material _material;
|
||||
private Material _material;
|
||||
private float _depth;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_camera = GetComponent<Camera>();
|
||||
_depth = Background.position.z;
|
||||
//_material = Background.GetComponent<MeshRenderer>().material;
|
||||
_material = Background.GetComponent<MeshRenderer>().material;
|
||||
}
|
||||
|
||||
private void OnPreRender()
|
||||
{
|
||||
//_material.SetVector("Rot1", );
|
||||
_material.SetVector("ParallaxDirection", transform.position);
|
||||
_ratio = (float) Screen.height / Screen.width;
|
||||
Background.position = new Vector3(transform.position.x, transform.position.y, _depth);
|
||||
var size = _camera.orthographicSize;
|
||||
|
|
|
|||
Loading…
Reference in a new issue