Ejemplo n.º 1
0
        public IEnumerator ExecuteLogic_Coroutine(ITextWrapperComponent pText, string strText)
        {
            if (bUseRealTime)
            {
                yield return(new WaitForSecondsRealtime(fDelaySecond));
            }
            else
            {
                yield return(new WaitForSeconds(fDelaySecond));
            }

            pText.strText = "";
            float fProgress_0_1 = 0f;

            while (fProgress_0_1 < 1f)
            {
                int iTextLength = (int)(strText.Length * fProgress_0_1);
                pText.strText = strText.Substring(0, iTextLength);

                if (bUseRealTime)
                {
                    fProgress_0_1 += Time.unscaledDeltaTime / fDurationSecond;
                }
                else
                {
                    fProgress_0_1 += Time.deltaTime / fDurationSecond;
                }

                yield return(null);
            }

            pText.strText = strText;

            yield break;
        }
Ejemplo n.º 2
0
        // ========================================================================== //

        /* protected - [Override & Unity API]       */

        protected override void OnAwake()
        {
            base.OnAwake();

            if (pTextWrapper == null)
            {
                pTextWrapper = GetComponentInChildren <ITextWrapperComponent>();
            }

            for (int i = 0; i < listLogic_Insert_OnAwake.Count; i++)
            {
                DoAddLogic(listLogic_Insert_OnAwake[i].eEventWhen, listLogic_Insert_OnAwake[i].pPopupTextLogic);
            }
        }