Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // TransformCopier.cs v 1.2
- // homepage: http://wiki.unity3d.com/index.php/CopyTransform
- using UnityEngine;
- using UnityEditor;
- using System.Collections;
- using System;
- // da mettersi sotto una cartella Editor sotto Assets
- public class TransformCopier : ScriptableObject
- {
- [MenuItem("CONTEXT/Transform/Copy Position to clipboard")]
- private static void CopyTransformToClipboard()
- {
- Debug.Log("Copy position to clipboard");
- Vector3 position = Selection.activeTransform.localPosition;
- //Vector3 rotation = Selection.activeTransform.rotation.eulerAngles;
- string vectorString = String.Format("Vector3({0}f,{1}f,{2}f)", position.x.ToString(), position.y.ToString(), position.z.ToString());
- //vectorString += String.Format(",Vector3({0},{1},{2})", rotation.x.ToString(), rotation.y.ToString(), rotation.z.ToString());
- Debug.Log(String.Format("Copied {0}", vectorString));
- GUIUtility.systemCopyBuffer = vectorString;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement