Move files around so it's easier to navigate the scripts folder
This commit is contained in:
50 files changed
No files matched your search
@@ -0,0 +1,15 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class RainbowCamera : MonoBehaviour {
|
||||
public float frequency = 1f;
|
||||
[Range(0, 255)]
|
||||
public int brightness = 255;
|
||||
|
||||
void Update() {
|
||||
float t = Time.time * frequency;
|
||||
float r = (Mathf.Sin(t) * 0.5f + 0.5f) * (brightness / 255f);
|
||||
float g = (Mathf.Sin(t + 2f) * 0.5f + 0.5f) * (brightness / 255f);
|
||||
float b = (Mathf.Sin(t + 4f) * 0.5f + 0.5f) * (brightness / 255f);
|
||||
Camera.main.backgroundColor = new Color(r, g, b);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user