首页 > 其他分享 >unity3d:复制选中物体transform信息到剪切板

unity3d:复制选中物体transform信息到剪切板

时间:2022-11-01 11:07:33浏览次数:45  
标签:unity3d trans localPosition transform System localEulerAngles 剪切板 using te


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class SaveTransInfo : EditorWindow
{

[MenuItem("SaveTransInfo/SaveOriInfoTo #`")]
static void SaveOriInfoTo()
{
GameObject obj = Selection.activeGameObject;
Transform trans = obj.transform;
string angles = trans.localEulerAngles.x + "," + trans.localEulerAngles.y + "," + trans.localEulerAngles.z;
string str = trans.localPosition.x + "," + trans.localPosition.y + "," + trans.localPosition.z + ";" + angles;

TextEditor te = new TextEditor();
te.content = new GUIContent(str);
te.SelectAll();
te.Copy();
}
}

配合策划改表


标签:unity3d,trans,localPosition,transform,System,localEulerAngles,剪切板,using,te
From: https://blog.51cto.com/u_15544328/5812297

相关文章

  • unity3d:ugui 每个字间隔间距
    usingUnityEngine;usingSystem.Collections;usingUnityEngine.UI;usingSystem;usingSystem.Collections.Generic;publicclassLine{privateint_startVertexInde......
  • Unity3D :Mob SMSSDK 运行崩溃
    报错信息android.content.ActivityNotFoundException:Unabletofindexplicitactivityclass{com.shuiying.smsm09061/com.mob.tools.MobUIShell};haveyoudeclaredt......
  • unity3d:显示FPS
    usingSystem.Collections;usingSystem.Collections.Generic;usingUnityEngine;publicclassFPSShow:MonoBehaviour{privatevoidOnGUI(){stringte......
  • unity3d:编辑器脚本,替换选中物体的材质
    usingSystem.Collections;usingSystem.Collections.Generic;usingUnityEngine;usingUnityEditor;publicclassChangeMat:MonoBehaviour{[MenuItem("Tools/Chang......
  • unity3d:xlua 加载自定义Loader
    在xLua加自定义loader是很简单的,只涉及到一个接口:publicdelegatebyte[]CustomLoader(refstringfilepath);publicvoidLuaEnv.AddLoader(CustomLoaderloader)通过A......
  • unity3d:xlua hotfix 官方例子
    1.新建工程,xlua文件夹与Plugins文件夹放入assets,tools放assets同级目录2.添加宏:HOTFIX_ENABLE3.D:\WorkSoft\unity2017.2.0\Editor\Data\Managed3个文件Unity.Cecil.dll,U......
  • UVA12003 Array Transformer(分块,块内二分)
    我们考虑用分块来水过此题我们先将原序列进行分块,对于某个块\(B\)内的数,我们把它们放进一个数组\(block[B][\]\)里,再对数组进行排序。那么我们就得到了\(\sqrt{n}\)......
  • 生动说明Transformer,BERT,预训练模型的含义和关系
    很多知识,尽管在学会了之后发现原来是多么的简单,但是当你刚接触的时候则是完全一头雾水。在我学习自然语言处理的入门教程时,很多教程都把Transformer和BERT连在一起讲,并......
  • 关于Transformer中feed forward layer理解
    今天记录一下个人关于Transformer中前馈神经网络(FFN)的一点理解。我们知道,FFN之前是有一个多头注意力机制的模块。我们可以想想一下,如果这个模块直接输出,不经过FFN层会发生......
  • 【自然语言处理(NLP)】基于Transformer的中-英机器翻译
    文章目录​​【自然语言处理(NLP)】基于Transformer的中-英机器翻译​​​​前言​​​​(一)、任务描述​​​​(二)、环境配置​​​​一、数据准备​​​​(一)、加载开发......