Hello everyone ,
I’ve done a home scene for an android app , and i’d like to give to a main camera a script , that relieve all white colors (I mean the grey color too) and it changes it in a given time.
Heres what i tryed to do BUT this changes the BACKGROUND not the GLOBAL WHITE:
using UnityEngine;
using System.Collections;
public class CameraCambiaColori : MonoBehaviour {
// ping-pong animate background color
public Color color1 = Color.red;
public Color color2 = Color.blue;
public float duration = 3.0F;
Camera camera;
void Start() {
camera = GetComponent<Camera>();
camera.clearFlags = CameraClearFlags.SolidColor; // i dont want to change the bg color but all white colors finds....
}
void Update() {
float t = Mathf.PingPong(Time.time, duration) / duration;
camera.backgroundColor = Color.Lerp(color1, color2, t);
}
}