Пример #1
0
        public void FadeOutUI(GameObject obj, float time, float delay, iTween.EaseType easetype = iTween.EaseType.easeOutCubic)
        {
            FadeGui fadeGui = obj.GetComponent <FadeGui>();

            if (fadeGui == null)
            {
                fadeGui = obj.AddComponent <FadeGui>();
                obj.GetComponent <CanvasGroup>().alpha = 1f;
            }

            fadeGui.FadeOut(time, delay, easetype);
        }
Пример #2
0
        // gui
        public void FadeInOutUI(GameObject inObj, GameObject outObj, float time, float delay, iTween.EaseType easetype = iTween.EaseType.easeOutCubic)
        {
            FadeGui fadeGuiIn = inObj.GetComponent <FadeGui>();

            if (fadeGuiIn == null)
            {
                fadeGuiIn = inObj.AddComponent <FadeGui>();
                inObj.GetComponent <CanvasGroup>().alpha = 0f;
            }

            FadeGui fadeGuiOut = outObj.GetComponent <FadeGui>();

            if (fadeGuiOut == null)
            {
                fadeGuiOut = outObj.AddComponent <FadeGui>();
                outObj.GetComponent <CanvasGroup>().alpha = 1f;
            }

            fadeGuiIn.FadeIn(time, delay, easetype);
            fadeGuiOut.FadeOut(time, delay, easetype);
        }