private void Update() { float iceLerp = plainManager.GetIceLerp(); float cutoffParam = GameUtils.Map(iceLerp, 0f, 1f, cutoffRange.Low(), cutoffRange.High()); mixer.SetFloat("LowpassCutoff", cutoffParam); float resonanceParam = GameUtils.Map(iceLerp, 0f, 1f, resonanceRange.Low(), resonanceRange.High()); mixer.SetFloat("LowpassResonance", resonanceParam); float echoLerp = plainManager.GetEchoLerp(); float echoParam = GameUtils.Map(echoLerp, 0f, 1f, echoRange.Low(), echoRange.High()); mixer.SetFloat("EchoDecay", echoParam); float metalLerp = plainManager.GetMetalLerp(); float ampParam = GameUtils.Map(metalLerp, 0.5f, 1f, ampRange.Low(), ampRange.High()); mixer.SetFloat("MasterVolume", ampParam); // float cutoffParam = GameUtils.Map(iceLerp, 0f, 1f, 500f, 1200.0f); // float metalParam = GameUtils.Map(metalLerp, 0.5f, 1f, 0f, 127f); // float cutoffParam = GameUtils.Map(metalLerp, 0.5f, 1f, 0f, 1200.0f); }
public void UpdateSubstance() { string metallicName = UndulatingPlainConstants.metallicSubstancePropertyName; plainSubstance.SetInputFloat(metallicName, plainManager.GetMetalLerp()); string iceName = UndulatingPlainConstants.iceSubstancePropertyName; plainSubstance.SetInputFloat(iceName, plainManager.GetIceLerp()); // queue for render plainSubstance.QueueForRender(); //render all substances async Substance.Game.Substance.RenderSubstancesAsync(); }