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.

30 lines
751 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: [ 040_Controls_Panel_Menu ]
  9. /// </example>
  10. public class PanelMenuDemoFlyingSaucer : 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. };
  23. public void UpdateGridLayoutValue(int selectedIndex)
  24. {
  25. transform.GetChild(1).GetComponent<MeshRenderer>().materials[0].color = colors[selectedIndex];
  26. }
  27. }
  28. }