本文整理汇总了C#中TextEditor.Copy方法的典型用法代码示例。如果您正苦于以下问题:C# TextEditor.Copy方法的具体用法?C# TextEditor.Copy怎么用?C# TextEditor.Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextEditor
的用法示例。
在下文中一共展示了TextEditor.Copy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CopyToClipBoard
public void CopyToClipBoard()
{
TextEditor te = new TextEditor();
te.text = seedValue.Seed;
te.SelectAll();
te.Copy();
}
示例2: sendClick
public void sendClick (GPSDefinition.GPSPoint point) { //Pass it on
cameraObject.SendMessage("moveToObserve", point);
TextEditor te = new TextEditor ();
te.content = new GUIContent (point.originalGPS);
te.SelectAll ();
te.Copy ();
}
示例3: CopyText
void CopyText(string pText)
{
TextEditor editor = new TextEditor();
editor.content = new GUIContent(pText);
editor.SelectAll();
editor.Copy();
}
示例4: copyText
public void copyText()
{
TextEditor text = new TextEditor();
text.content = new GUIContent(custom.exportSong());
text.SelectAll();
text.Copy();
}
示例5: CopyText
public void CopyText()
{
TextEditor te = new TextEditor();
te.content = new GUIContent(ToCSV());
te.SelectAll();
te.Copy();
}
示例6: CopyToClipboard
public static void CopyToClipboard(string str)
{
TextEditor te = new TextEditor();
te.text = str;
te.OnFocus();
te.Copy();
}
示例7: CopyTR
static void CopyTR()
{
var sels = Selection.GetFiltered(typeof(Transform), SelectionMode.Unfiltered);
string info = "";
int index = 0;
sels = SortSels(sels);
foreach (var s in sels)
{
Transform t = s as Transform;
Vector3 pos = t.position;
Vector3 rot = t.rotation.eulerAngles;
if (index != 0)
{
info += "\n";
}
info += string.Format("{1:F2}\t{2:F2}\t{3:F2}\t", info, pos.x, pos.y, pos.z);
info += string.Format("{1:F2}\t {2:F2}\t{3:F2}", info, rot.x, rot.y, rot.z);
index++;
}
TextEditor tempEditor = new TextEditor();
tempEditor.content = new GUIContent(info);
tempEditor.SelectAll();
tempEditor.Copy();
tempEditor = null;
Debug.Log("Copy TR");
}
示例8: CopyPose
void CopyPose()
{
string str = "<EXPRESSION_NAME_HERE>"+System.Environment.NewLine;
foreach (string bone in pose.Keys) {
if(pose[bone]["X"] != 0f || pose[bone]["Y"] != 0f || pose[bone]["Z"] != 0f) {
str+=bone+","+pose[bone]["X"]+","+pose[bone]["Y"]+","+pose[bone]["Z"]+System.Environment.NewLine;
}
}
TextEditor te = new TextEditor();
te.text = str;
te.SelectAll();
te.Copy();
}
示例9: OnGUI
//绘制窗口时调用
void OnGUI ()
{
GUILayout.TextArea (textShow);
if (GUILayout.Button ("复制代码", GUILayout.Width (200)))
{
TextEditor te = new TextEditor();
te.content = new GUIContent(textShow);
te.OnFocus();
te.Copy();
this.ShowNotification(new GUIContent("代码已复制"));
}
}
示例10: OnInspectorGUI
public override void OnInspectorGUI()
{
GUILayout.BeginHorizontal();
if (GUILayout.Button("拷贝到剪贴板")) {
List<NpcConfig> bornPoints = new List<NpcConfig>();
configs.transform.GetComponentsInChildren<NpcConfig>(true, bornPoints);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < bornPoints.Count; i++) {
sb.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}", bornPoints[i].CampId, bornPoints[i].ActorId, bornPoints[i].transform.position.x, bornPoints[i].transform.position.z, bornPoints[i].transform.rotation.eulerAngles.y, bornPoints[i].Level, bornPoints[i].IsPassive);
sb.AppendLine();
}
string text = sb.ToString();
TextEditor editor = new TextEditor();
//editor.text = text;
editor.content = new GUIContent(text);
editor.OnFocus();
editor.Copy();
}
GUILayout.EndHorizontal();
}
示例11: CopyToClipboard
void CopyToClipboard()
{
string info = "";
int childrenCount = thisTarget.transform.childCount;
for (int i = 0; i < childrenCount; i++)
{
Vector3 pos = thisTarget.transform.GetChild(i).position;
info += string.Format("{1:F2}\t{2:F2}\t{3:F2}\n", info, pos.x, pos.y, pos.z);
}
if (childrenCount > 2 && thisTarget.isLoop) {
Vector3 pos = thisTarget.transform.GetChild(0).position;
info += string.Format("{1:F2}\t{2:F2}\t{3:F2}\n", info, pos.x, pos.y, pos.z);
}
TextEditor tempEditor = new TextEditor();
tempEditor.content = new GUIContent(info);
tempEditor.SelectAll();
tempEditor.Copy();
tempEditor = null;
}
示例12: CopyPGNToClipboard
public void CopyPGNToClipboard() {
string dateString = System.DateTime.Today.Year + "." + System.DateTime.Today.Month + "." + System.DateTime.Today.Day;
string modeName = "Regular mode";
if (GameManager.gameModeIndex > 0) {
modeName = "Blindfold Training; level " + (GameManager.gameModeIndex);
}
string pgn = "";
pgn += "[Event \"" +modeName+ "\"]\n";
pgn += "[Site \"http://sebastian.itch.io/blindfoldchess\"]\n";
pgn += "[Date \"" + dateString + "\"]\n";
pgn += "[White \"Human\"]\n";
pgn += "[Black \"Computer\"]\n";
pgn += "[Result \"" + resultStringShorthand + "\"]\n";
pgn += "\n" + PGNDisplay.GetGamePGN ();
if (pgn [pgn.Length - 1] != ' ') {
pgn += " ";
}
pgn += resultStringShorthand;
TextEditor t = new TextEditor ();
t.content = new GUIContent (pgn);
t.SelectAll ();
t.Copy ();
Debug.Log (t.content.text);
}
示例13: OnGUI
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.BeginProperty(position, label, property);
property.isExpanded = EditorGUI.Foldout(new Rect(position.x, position.y, 80, c_FieldHeight), property.isExpanded, label);
if (property.isExpanded) {
float w = position.width;
position.width = c_LabelWidth;
position.height = c_FieldHeight;
float x = position.x;
float y = position.y;
EditorGUI.LabelField(position, label);
InplaceSkillInfo info = property.serializedObject.targetObject as InplaceSkillInfo;
Dictionary<int, InplaceSkillInfo.InplaceSkillPropertyInfoGroup> dict = info.Properties;
foreach (var pair in dict) {
int skillId = pair.Key;
var group = pair.Value;
position.x = x;
position.y += c_FieldHeight;
group.IsFoldOut = EditorGUI.Foldout(position, group.IsFoldOut, "============<" + skillId + ">============");
if (group.IsFoldOut) {
//技能可视编辑特性部分
if (null != group.PropertyList) {
string lastGroup = string.Empty;
foreach (var p in group.PropertyList) {
position.x = x;
position.y += c_FieldHeight;
position.width = c_LabelWidth;
if (lastGroup == p.Group) {
EditorGUI.LabelField(position, string.Empty);
} else {
EditorGUI.LabelField(position, GetIndentLabel(p.Group));
}
position.x += c_LabelWidth;
position.width = 160;
EditorGUI.LabelField(position, null == p.Key ? string.Empty : p.Key);
var prop = p.Property;
if (null != prop && prop.Value is AnimationCurve) {
float tx = position.x;
position.x += 160;
EditorGUI.BeginChangeCheck();
object v = EditorGUI.CurveField(position, prop.Value as AnimationCurve);
if (EditorGUI.EndChangeCheck()) {
prop.Value = v;
}
position.x = tx + 120;
position.width = 40;
if (GUI.Button(position, "拷贝")) {
AnimationCurve curve = v as AnimationCurve;
if (null != curve) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < curve.keys.Length; ++i) {
Keyframe key = curve.keys[i];
sb.AppendFormat("keyframe({0},{1},{2},{3});", key.time, key.value, key.inTangent, key.outTangent);
sb.AppendLine();
}
string text = sb.ToString();
TextEditor editor = new TextEditor();
editor.text = text;
//editor.content = new GUIContent(text);
editor.OnFocus();
editor.Copy();
}
}
} else {
position.x += 160;
EditProperty(position, p.Property);
}
lastGroup = p.Group;
}
}
//技能资源(这里就不允许新加资源了,只能修改)
TableConfig.Skill skillCfg = TableConfig.SkillProvider.Instance.GetSkill(skillId);
if (null != skillCfg) {
position.x = x;
position.y += c_FieldHeight;
position.width = c_LabelWidth;
EditorGUI.LabelField(position, "==================");
position.x += c_LabelWidth;
position.width = 160;
EditorGUI.LabelField(position, "SkillResources");
position.x += 160;
EditorGUI.LabelField(position, "============");
bool first = true;
Dictionary<string, string> modifiedResources = new Dictionary<string, string>();
foreach (var resPair in skillCfg.resources) {
string key = resPair.Key;
string path = resPair.Value;
position.x = x;
position.y += c_FieldHeight;
position.width = c_LabelWidth - 80;
if (first) {
EditorGUI.LabelField(position, ">>>resource");
} else {
//.........这里部分代码省略.........
示例14: CopyEditedSkillsToClipboard
private void CopyEditedSkillsToClipboard()
{
SaveEditedSkills(HomePath.GetAbsolutePath("../../../edit_skills_bak.txt"));
string text = GetEditedSkillsText();
TextEditor editor = new TextEditor();
editor.text = text;
//editor.content = new GUIContent(text);
editor.OnFocus();
editor.Copy();
}
示例15: OnInspectorGUI
public override void OnInspectorGUI()
{
DrawDefaultInspector();
if (GUILayout.Button("拷贝到剪贴板")) {
InplaceSkillInfo info = target as InplaceSkillInfo;
if (null != info) {
var props = info.Properties;
StringBuilder sb = new StringBuilder();
foreach (var pair in props) {
int skillId = pair.Key;
var group = pair.Value;
sb.AppendFormat("========================dsl:{0}========================", skillId);
sb.AppendLine();
if (null != group.PropertyList) {
string lastGroup = string.Empty;
foreach (var prop in group.PropertyList) {
if (!string.IsNullOrEmpty(lastGroup) && lastGroup != prop.Group) {
sb.AppendLine();
}
if (null != prop.Property && null != prop.Property.Value && !(prop.Property.Value is AnimationCurve)) {
sb.AppendFormat("{0}:{1}\t{2}", prop.Group, prop.Key, prop.Property.Value.ToString());
sb.AppendLine();
} else {
sb.AppendFormat("{0}:{1}", prop.Group, prop.Key);
sb.AppendLine();
}
lastGroup = prop.Group;
}
}
sb.AppendLine();
TableConfig.Skill skillCfg = TableConfig.SkillProvider.Instance.GetSkill(skillId);
if (null != skillCfg) {
sb.AppendLine("=====================SkillResources=====================");
foreach (var resPair in skillCfg.resources) {
sb.AppendFormat("{0}\t{1}\t{2}", skillId, resPair.Key, resPair.Value);
sb.AppendLine();
}
sb.AppendLine("====================EndSkillResources===================");
}
}
string text = sb.ToString();
TextEditor editor = new TextEditor();
editor.text = text;
//editor.content = new GUIContent(text);
editor.OnFocus();
editor.Copy();
}
}
}