示例#1
0
    private IEnumerator Switch(GameObject currentPanel, GameObject nextPanel, float fadein, float fadeout)
    {
        PanelFade2 current = currentPanel.GetComponent <PanelFade2>(),
                   next    = nextPanel.GetComponent <PanelFade2>();

        current.Close(fadeout);
        yield return(new WaitForSeconds(fadeout + 1f));

        nextPanel.SetActive(true);
        next.Open(fadein);
    }
示例#2
0
        private IEnumerator Switch(GameObject currentPanel, GameObject nextPanel, float fadein, float fadeout)
        {
            PanelFade2 current = currentPanel.GetComponent <PanelFade2>(),
                       next    = nextPanel.GetComponent <PanelFade2>();

            Debug.Log("AvgPanelSwitch 进入coroutine");
            if (current != null)
            {
                current.Close(fadeout);
                yield return(new WaitForSeconds(fadeout + 1f));
            }

            //nextPanel.SetActive(true);

            next.Open(fadein);
        }