ayks
December 15, 2015, 8:24pm
1
Hi,
is it possible to copy paste the 3 position (x,y,z) in one time and paste it in editor like notepad ?
I always have to copy paste x, then y, then z
I know about copy paste the whole parameters in another object but that is not related.
Thanks
Don’t think there’s a default way to do that. However, you could write an Editor script:
using UnityEngine;
using UnityEditor;
// Adds MenuItems to Unity Editor for copy/paste selected transform's position
public class CopyPositionEditor : ScriptableObject {
static Vector3 cachedPosition;
[MenuItem ("Edit/Copy Transform Position %#c")]
static void CopyPosition () {
if (Selection.activeTransform != null)
{
cachedPosition = Selection.activeTransform.position;
EditorGUIUtility.systemCopyBuffer = cachedPosition.x + ", " +
cachedPosition.y + ", " +
cachedPosition.z;
}
}
[MenuItem ("Edit/Paste Transform Position %#v")]
static void PastePosition () {
if (Selection.activeTransform != null)
{
Undo.RecordObject (Selection.activeTransform, "Paste Transform Position");
Selection.activeTransform.position = new Vector3(cachedPosition.x,
cachedPosition.y,
cachedPosition.z);
}
}
}