KinectOffsetAdjuster.cs 826 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class KinectOffsetAdjuster : MonoBehaviour {
  6. Vector3 offset;
  7. // Use this for initialization
  8. void Start () {
  9. }
  10. // Update is called once per frame
  11. void Update () {
  12. }
  13. public void AdjustOffset(Slider slider)
  14. {
  15. switch (slider.name)
  16. {
  17. case "X":
  18. offset.x = slider.value;
  19. break;
  20. case "Y":
  21. offset.y = slider.value;
  22. break;
  23. case "Z":
  24. offset.z = slider.value;
  25. break;
  26. default:
  27. Debug.Log("Unknown Slider");
  28. break;
  29. }
  30. transform.localPosition = offset;
  31. }
  32. }