Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if UNITY_EDITOR
- using UnityEngine;
- using UnityEditor;
- using System.Collections;
- using System.Collections.Generic;
- public class TransformMacros : Editor {
- [MenuItem("Macros/Snap Selection To Ground")]
- public static void SnapToGround() {
- foreach (Transform t in Selection.transforms) {
- RaycastHit rayhit;
- if (Physics.Raycast(t.position, Vector3.down, out rayhit)) {
- t.position = rayhit.point;
- }
- }
- }
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement