Exemplo n.º 1
0
        /// <summary>
        /// Called by cubism update controller. Updates controller.
        /// </summary>
        /// <remarks>
        /// Make sure this method is called after any animations are evaluated.
        /// </remarks>
        public void OnLateUpdate()
        {
            // Fail silently.
            if (!enabled || Destinations == null)
            {
                return;
            }


            // Apply value.
            Destinations.BlendToValue(BlendMode, MouthOpening);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Called by Unity. Updates controller.
        /// </summary>
        private void LateUpdate()
        {
            var nowT    = Time.time;
            var tilTime = nowT - T;

            if (CurrentPhase == Phase.inBreath)
            {
                phaseCode = 1;
                if (tilTime > inTime)
                {
                    T            = T + inTime;
                    CurrentPhase = Phase.outBreath;
                    LateUpdate();
                    return;
                }
                sendValue = inOutQuad(tilTime, 0, 1, inTime);
                Destinations.BlendToValue(mode, sendValue);
            }
            else if (CurrentPhase == Phase.outBreath)
            {
                phaseCode = 2;
                if (tilTime > outTime)
                {
                    T            = T + outTime;
                    CurrentPhase = Phase.Idling;
                    LateUpdate();
                    return;
                }
                sendValue = inOutQuad(outTime - tilTime, 0, 1, outTime);
                Destinations.BlendToValue(mode, sendValue);
            }
            else
            {
                phaseCode = 3;
                if (tilTime > offTime)
                {
                    T            = T + offTime;
                    CurrentPhase = Phase.inBreath;
                    LateUpdate();
                    return;
                }
                sendValue = 0;
                Destinations.BlendToValue(mode, sendValue);
            }
        }