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; }
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); }
public virtual void OnCreate() { if (Scope == RTPCScope.Local) { value = TypePoolManager.Create <AudioValue <float> >(); } else { value = GetGlobalRTPCValue(Name); } lastValue = Curve.Evaluate(GetRatio()); }
public float GetAdjustedValue() { float ratio = GetRatio(); float value; if (ratio == lastRatio) { value = lastValue; } else { value = Curve.Evaluate(ratio); } lastRatio = ratio; lastValue = value; return(value); }