RenderModelChangerUI.cs 711 B

1234567891011121314151617181920212223242526272829303132
  1. //======= Copyright (c) Valve Corporation, All rights reserved. ===============
  2. using UnityEngine;
  3. using System.Collections;
  4. namespace Valve.VR.InteractionSystem.Sample
  5. {
  6. public class RenderModelChangerUI : UIElement
  7. {
  8. public GameObject leftPrefab;
  9. public GameObject rightPrefab;
  10. protected SkeletonUIOptions ui;
  11. protected override void Awake()
  12. {
  13. base.Awake();
  14. ui = this.GetComponentInParent<SkeletonUIOptions>();
  15. }
  16. protected override void OnButtonClick()
  17. {
  18. base.OnButtonClick();
  19. if (ui != null)
  20. {
  21. ui.SetRenderModel(this);
  22. }
  23. }
  24. }
  25. }