Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
758 B

  1. namespace VRTK.Examples.PanelMenu
  2. {
  3. using UnityEngine;
  4. /// <summary>
  5. /// Demo component for Panel Menu example scene.
  6. /// </summary>
  7. /// <example>
  8. /// See the demo scene for a complete example: [ 038_Controls_Panel_Menu ]
  9. /// </example>
  10. public class PanelMenuDemoSphere : MonoBehaviour
  11. {
  12. private readonly Color[] colors =
  13. {
  14. Color.black,
  15. Color.blue,
  16. Color.cyan,
  17. Color.gray,
  18. Color.green,
  19. Color.magenta,
  20. Color.red,
  21. Color.white,
  22. Color.yellow,
  23. Color.black
  24. };
  25. public void UpdateSliderValue(float value)
  26. {
  27. GetComponent<MeshRenderer>().materials[0].color = colors[(int)(value - 1)];
  28. }
  29. }
  30. }