Example #1
0
 public virtual void Portion(LerpData ld)
 {
     if (UsingLinkedThreshold && Portion(ref ld.linkedPortion))
     {
         ld.dominantParameter = Name;
     }
     else if (lerpMode == LerpSpeedMode.UnlinkedSpeed)
     {
         float portion = 1;
         Portion(ref portion);
         ld.MinPortion = portion;
     }
 }
Example #2
0
            public void Lerp(LerpData ld, bool canTeleport = false)
            {
                if (!Enabled)
                {
                    return;
                }

                float p;

                switch (lerpMode)
                {
                case LerpSpeedMode.LerpDisabled:
                    p = 0;
                    break;

                case LerpSpeedMode.UnlinkedSpeed:
                    p = 1;
                    if (Application.isPlaying)
                    {
                        Portion(ref p);
                    }

                    if (canTeleport)
                    {
                        p = Mathf.Max(p, ld.teleportPortion);
                    }

                    break;

                default:
                    p = ld.Portion(canTeleport);
                    break;
                }

                LerpInternal(p);
                defaultSet = true;
            }