duck

Unity Random Rotation Editor Script

Jun 23rd, 2014
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.32 KB | None | 0 0
  1. using UnityEditor;
  2. using UnityEngine;
  3.  
  4. public class RandomRotate {
  5.  
  6.     [MenuItem ("GameObject/Random Rotation")]
  7.     static void RandomRotation () {
  8.         foreach (var t in Selection.transforms) {
  9.             Undo.RecordObject( t, "Random Rotation");
  10.             t.rotation = Random.rotation;
  11.         }
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment