Advertisement
Guest User

Untitled

a guest
May 29th, 2015
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #if UNITY_EDITOR
  2. using UnityEngine;
  3. using UnityEditor;
  4. using System.Collections;
  5. using System.Collections.Generic;
  6.  
  7.  
  8.  
  9.  
  10. public class TransformMacros : Editor {
  11. [MenuItem("Macros/Snap Selection To Ground")]
  12. public static void SnapToGround() {
  13. foreach (Transform t in Selection.transforms) {
  14. RaycastHit rayhit;
  15. if (Physics.Raycast(t.position, Vector3.down, out rayhit)) {
  16. t.position = rayhit.point;
  17. }
  18. }
  19. }
  20.  
  21. }
  22.  
  23. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement