示例#1
0
 public void Copy(AudioRTPC reference)
 {
     value     = reference.value;
     lastValue = reference.lastValue;
     lastRatio = reference.lastRatio;
     Name      = reference.Name;
     Type      = reference.Type;
     Scope     = reference.Scope;
     Range     = reference.Range;
     Curve     = reference.Curve;
 }
示例#2
0
        public static AudioValue <float> GetGlobalRTPCValue(string name)
        {
            AudioValue <float> value;

            if (!rtpcValues.TryGetValue(name, out value))
            {
                value            = TypePoolManager.Create <AudioValue <float> >();
                rtpcValues[name] = value;
            }

            return(value);
        }
示例#3
0
        public virtual void OnCreate()
        {
            if (Scope == RTPCScope.Local)
            {
                value = TypePoolManager.Create <AudioValue <float> >();
            }
            else
            {
                value = GetGlobalRTPCValue(Name);
            }

            lastValue = Curve.Evaluate(GetRatio());
        }
示例#4
0
        public float GetAdjustedValue()
        {
            float ratio = GetRatio();
            float value;

            if (ratio == lastRatio)
            {
                value = lastValue;
            }
            else
            {
                value = Curve.Evaluate(ratio);
            }

            lastRatio = ratio;
            lastValue = value;

            return(value);
        }