soundvision/UnityProject/Assets/Scenes/Examples/Composition/script/BallMapping.cs
2019-10-04 21:58:32 +02:00

19 lines
508 B
C#

using UnityEngine;
namespace cylvester
{
public class BallMapping : MonoBehaviour
{
[SerializeField] private GameObject ball = null;
[SerializeField] private float mapToSize = 10f;
[SerializeField] private RmsAnalyzer analyzer = null;
void Update()
{
var currentRms = analyzer.RMS;
var scale = currentRms * mapToSize;
ball.transform.localScale = new Vector3(scale, scale, scale);
}
}
}