Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
AngryBots/Assets/Editor/CopyTransform.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
31 lines (25 sloc)
1.12 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
public class TransformCopier : ScriptableObject | |
{ | |
private static Vector3 position; | |
private static Quaternion rotation; | |
//private static Vector3 scale; | |
[MenuItem ("Tools/Transform Copier/Copy Transform &%c")] | |
static void DoRecord() | |
{ | |
position = Selection.activeTransform.localPosition; | |
rotation = Selection.activeTransform.localRotation; | |
//scale = Selection.activeTransform.localScale; | |
// EditorUtility.DisplayDialog("Transform Copy", "Local position, rotation, & scale of "+myName +" copied relative to parent.", "OK", ""); | |
} | |
[MenuItem ("Tools/Transform Copier/Paste Transform &%v")] | |
static void DoApply() | |
{ | |
Selection.activeTransform.localPosition = position; | |
Selection.activeTransform.localRotation = rotation; | |
//Selection.activeTransform.localScale = scale; | |
// EditorUtility.DisplayDialog("Transform Paste", "Local position, rotation, and scale of "+myName +" pasted relative to parent of "+Selection.activeTransform.name+".", "OK", ""); | |
} | |
} | |