Esempio n. 1
0
        private void UpdateMotion()
        {
            if (elapsedMotionSeconds > TotalMotionSeconds)
            {
                return;
            }

            elapsedMotionSeconds += LoopEngine.DeltaSeconds;
            for (int i = 0; i < charList.Count; ++i)
            {
                MotionChar character = charList[i];

                float indexTime        = (elapsedMotionSeconds - i * CharMotionDelaySeconds) / CharMotionSeconds;
                float motionTime       = Mathf.Pow(Mathf.Clamp01(indexTime), 0.5f);
                float motionTimeInvert = 1f - motionTime;

                character.Offset = MotionStartOffset * motionTimeInvert;
                character.Alpha  = MotionStartAlpha + (1f - MotionStartAlpha) * motionTime;
            }
        }
Esempio n. 2
0
        private void UpdateChars()
        {
            ClearChars();

            MotionChar sampleChar = charPool.GetObject();

            SetCharStyle(sampleChar);
            sampleChar.Character = 'A';

            Vector2 charPosition = Vector2.zero;

            for (int i = 0; i < text.Length; ++i)
            {
                char characterSrc = text[i];
                switch (characterSrc)
                {
                case '\r':
                    break;

                case '\n':
                    charPosition.x  = 0f;
                    charPosition.y -= sampleChar.Bounds.y + FontSize * 0.2f;
                    break;

                default:
                    MotionChar character = charPool.GetObject();
                    charList.Add(character);

                    SetCharStyle(character);
                    character.Character = text[i];
                    character.Position  = charPosition;

                    charPosition.x += character.Bounds.x;
                    break;
                }
            }
            charPool.ReleaseObject(sampleChar);
        }
Esempio n. 3
0
 private void SetCharStyle(MotionChar character)
 {
     character.Font      = Font;
     character.FontSize  = FontSize;
     character.FontColor = FontColor;
 }
Esempio n. 4
0
 private void ReleaseCharTask(MotionChar value)
 {
     value.GameObject.SetActive(false);
 }
Esempio n. 5
0
 private void GetCharTask(MotionChar value)
 {
     value.GameObject.SetActive(true);
 }
Esempio n. 6
0
 private void DisposeCharTask(MotionChar value)
 {
     value.Dispose();
 }