SHARE
TWEET

Untitled

a guest May 29th, 2015 565 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #if UNITY_EDITOR
  2. using UnityEngine;
  3. using UnityEditor;
  4.  
  5. public class TransformMacros : Editor {
  6.         [MenuItem("Macros/Snap Selection To Ground &#v")]
  7.         public static void SnapToGround() {
  8.                 foreach (Transform t in Selection.transforms) {
  9.                         RaycastHit rayhit;
  10.                         if (Physics.Raycast(t.position, Vector3.down, out rayhit)) {
  11.                                 t.position = rayhit.point;
  12.                         }
  13.                 }
  14.         }
  15.        
  16. }
  17.  
  18. #endif
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top