I searched far and wide about how to make a panel fade in and out, with no success. I have a scene, and two logos, one for my school, and one for my group. I have two panels, one for each logo, and I wanted to make them go:
Black screen > Fade In Panel#1 > Stay (3 sec) > Fade Out Panel#1 > Black Screen (0.5 sec) > Fade In Panel#2 > Stay (3 sec) > Fade Out Panel#3 > Black Screen (0.5 sec) > Fade In Menu. (Do not worry about the menu, it’s not important right now).
This is what I have done until now:
public class DelayLogo : MonoBehaviour
{
public float marcador;
public float intervalo;
public GameObject PanelPUCLogo;
public GameObject PanelLuftLogo;
// Use this for initialization
void Start()
{
marcador = Time.time;
intervalo = 2.0f;
}
// Update is called once per frame
void Update()
{
if (Time.time - marcador >= intervalo || Input.anyKey)
{
PanelPUCLogo.SetActive(true);
}
if (Time.time - marcador >= intervalo + 3 || Input.anyKey)
{
PanelLuftLogo.SetActive(true);
PanelPUCLogo.SetActive(false);
}
}
}
This is what this script does:
Black Screen > Panel#1 (3 sec) > Panel#2 (3sec). It doesn’t fade in/out anything.
Btw,
PanelPUCLogo = Panel#1 In my example;
PanelLuftLogo = Panel#2 in my example