public void ConfigureAnimationSettings(Puppet puppet) { int selectedOption = animationSelection.value; if (animationRandomizeToggle.isOn) { selectedOption = UnityEngine.Random.Range(0, animationSelection.options.Count); } switch (animationSelection.options[selectedOption].text) { case "Position": puppet.style = Puppet.MotionStyle.Position; break; case "Rotation": puppet.style = Puppet.MotionStyle.Rotation; break; case "Scale": puppet.style = Puppet.MotionStyle.Scale; break; default: Debug.Log("ERROR: Unknown animation selected"); break; } foreach (Animation animation in puppet.GetComponentsInChildren <Animation>()) { animation.speed = animationSlider.value; } }