NEW CLOUDS NEW CLOUDS NEW CLOUDS WHOOO
Added new clouds shader with improved raymarching loop Currently only being used in main menu (rest is coming right up!) Removed WWise (it's nice, but all it's doing is throwing exceptions rn since we ain't about to get a license)
This commit is contained in:
parent
4a369a1266
commit
b08423b936
1066 changed files with 9806 additions and 58766 deletions
46
Assets/Plugins/AtmosphereScattering/Scripts/CameraControl.cs
Normal file
46
Assets/Plugins/AtmosphereScattering/Scripts/CameraControl.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CameraControl : MonoBehaviour {
|
||||
public float distance = 10.0f;
|
||||
public Vector3 center;
|
||||
|
||||
private Vector2 lastFrameMouse;
|
||||
|
||||
public float scale = 1.0f;
|
||||
|
||||
public float distanceSpeed = .1f;
|
||||
public float rotationSpeed = .1f;
|
||||
|
||||
private void Update() {
|
||||
var mouseDelta = (Vector2)Input.mousePosition - lastFrameMouse;
|
||||
lastFrameMouse = Input.mousePosition;
|
||||
|
||||
if (Input.GetMouseButton(2)) {
|
||||
//Translate.
|
||||
center += ((transform.right * mouseDelta.x) + (transform.up * mouseDelta.y)) * scale * distance;
|
||||
}
|
||||
|
||||
if (Input.GetMouseButton(1)) {
|
||||
distance += mouseDelta.x * distanceSpeed * Mathf.Max(1.0f, 0.1f * distance);
|
||||
}
|
||||
|
||||
if (Input.GetMouseButton(0)) {
|
||||
//Rotate.
|
||||
var currentRotation = transform.rotation;
|
||||
var currentYaw = currentRotation.eulerAngles.y;
|
||||
var currentPitch = currentRotation.eulerAngles.x;
|
||||
|
||||
currentPitch -= mouseDelta.y * rotationSpeed;
|
||||
currentYaw += mouseDelta.x * rotationSpeed;
|
||||
currentPitch = Mathf.Max(0, currentPitch);
|
||||
|
||||
var newRotation = Quaternion.Euler(currentPitch, currentYaw, 0.0f);
|
||||
|
||||
transform.rotation = newRotation;
|
||||
}
|
||||
|
||||
transform.position = transform.rotation * Vector3.forward * -distance + center;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue