Advertisement
Guest User

Untitled

a guest
Apr 13th, 2016
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. public static void SetX(GameObject go, float x) {
  2. Vector3 v = go.transform.position;
  3. v.x = x;
  4. go.transform.position = v;
  5. }
  6.  
  7. public static void SetY(GameObject go, float y) {
  8. Vector3 v = go.transform.position;
  9. v.y = y;
  10. go.transform.position = v;
  11. }
  12.  
  13. public static void SetZ(GameObject go, float z) {
  14. Vector3 v = go.transform.position;
  15. v.z = z;
  16. go.transform.position = v;
  17. }
  18.  
  19. public static void SetLocalX(GameObject go, float x) {
  20. Vector3 v = go.transform.localPosition;
  21. v.x = x;
  22. go.transform.localPosition = v;
  23. }
  24.  
  25. public static void SetLocalY(GameObject go, float y) {
  26. Vector3 v = go.transform.localPosition;
  27. v.y = y;
  28. go.transform.localPosition = v;
  29. }
  30.  
  31. public static void SetLocalZ(GameObject go, float z) {
  32. Vector3 v = go.transform.localPosition;
  33. v.z = z;
  34. go.transform.localPosition = v;
  35. }
  36.  
  37. public static void SetScaleX(GameObject go, float x) {
  38. Vector3 v = go.transform.localScale;
  39. v.x = x;
  40. go.transform.localScale = v;
  41. }
  42.  
  43. public static void SetScaleY(GameObject go, float y) {
  44. Vector3 v = go.transform.localScale;
  45. v.y = y;
  46. go.transform.localScale = v;
  47. }
  48.  
  49. public static void SetScaleZ(GameObject go, float z) {
  50. Vector3 v = go.transform.localScale;
  51. v.z = z;
  52. go.transform.localScale = v;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement