// Update is called once per frame public void UpdateAudioVariables(InteractableValue interactableValue) { if (m_AudioSource != null) { m_AudioSource.pitch = interactableValue.sliderPosition; m_AudioSource.volume = interactableValue.sliderPosition; } }
// Update is called once per frame public void UpdateEmission(InteractableValue interactableValue) { if (interactableValue.sliderPosition > 0.0f && !m_ps.isPlaying) { m_ps.Play(); } else if (interactableValue.sliderPosition == 0.0f && m_ps.isPlaying) { m_ps.Stop(); } var emission = m_ps.emission; emission.rateOverTime = interactableValue.sliderPosition * maxValue; }
public void OnSliderValueUpdate(InteractableValue interactableValue) { float globalSlider = interactableValue.sliderPosition; if (m_sliderScrubCounter != null) { float val = (globalSlider * m_sliderScrubCounter.scrubCount + 1) / m_sliderScrubCounter.maxScrubs; m_materialToUpdate.SetFloat(m_ShaderPropertyToChange, val); //Debug.Log("Setting skin material slider "+m_ShaderPropertyToChange+", to: "+ //"globalSlider{"+globalSlider+"} * m_sliderScrubCounter.scrubCount{"+m_sliderScrubCounter.scrubCount+1+"}) / m_sliderScrubCounter.maxScrubs{"+m_sliderScrubCounter.maxScrubs+"} = "+val); } else { m_materialToUpdate.SetFloat(m_ShaderPropertyToChange, globalSlider); } }
// Update is called once per frame public void UpdateRotation(InteractableValue interactableValue) { /* * Vector3 rot = transform.rotation.eulerAngles; * rot.x *= rotationDirection.x; * rot.y *= rotationDirection.y; * rot.z *= rotationDirection.z;*/ Vector3 newRot = rotationDirection * interactableValue.sliderPosition * maxAngle * weight; if (m_UseLocalRotation) { transform.localRotation = m_OriginalRotation * Quaternion.Euler(newRot); } else { transform.rotation = m_OriginalRotation * Quaternion.Euler(newRot); } }
public void UpdateAnimation(InteractableValue interactableValue) { m_Renderer.SetBlendShapeWeight(0, interactableValue.sliderPosition * 100f); }
public void DrainSpeedMod(InteractableValue interactableValue) { m_DrainTimeMod = interactableValue.sliderPosition; }
public void FillUpSpeedMod(InteractableValue interactableValue) { m_FillTimeMod = interactableValue.sliderPosition; }
public void UpdateAnimation(InteractableValue interactableValue) { value = interactableValue.sliderPosition; m_Animator.Play("duvetMove", 0, interactableValue.sliderPosition); }
// Update is called once per frame public void UpdateScale(InteractableValue interactableValue) { Vector3 scale = Vector3.Lerp(CachedMinVal, CachedMaxVal, interactableValue.sliderPosition); transform.localScale = scale; }
// Update is called once per frame public void UpdateBlendWeight(InteractableValue interactableValue) { skinnedMeshRenderer.SetBlendShapeWeight(0, interactableValue.sliderPosition * 100); }