예제 #1
0
    IEnumerator ShowHelp_Coroutine(GUIBase_Layout layout)
    {
        GUIBase_Button[] buttons = layout.GetComponentsInChildren <GUIBase_Button>();
        System.Array.Sort(buttons, (x, y) => { return(string.Compare(x.name, y.name)); });

        foreach (var button in buttons)
        {
            button.Widget.SetFadeAlpha(0.0f, true);
        }

        yield return(new WaitForSeconds(m_FirstHelpDelay));

        foreach (var button in buttons)
        {
            if (button.Widget.Visible == false)
            {
                continue;
            }

            if (m_ShowHelpSound != null)
            {
                PlayOneShotWithFade(m_ShowHelpSound, 0.05f);
            }

            while (button.Widget.FadeAlpha < 1.0f)
            {
                button.Widget.SetFadeAlpha(button.Widget.FadeAlpha + Time.deltaTime / m_FadeInHelpTime, true);

                yield return(new WaitForEndOfFrame());
            }

            yield return(new WaitForSeconds(m_NextHelpDelay));
        }
    }