Skip to content

Commit df926fb

Browse files
committed
add copy button
1 parent 4335c59 commit df926fb

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

app/Assets/UniDebugMenu/Scripts/TextList/SimpleTextListDataCreator.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
using UniDebugMenu.Example;
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43
using System.Linq;
4+
using UniDebugMenu.Example;
5+
using UnityEngine;
56

67
namespace UniDebugMenu
78
{
@@ -20,12 +21,18 @@ public class SimpleTextListDataCreator : ListCreatorBase<ActionData>
2021
// 変数
2122
//==============================================================================
2223
private IList<ActionData> m_list;
24+
private string m_text;
2325

2426
//==============================================================================
2527
// プロパティ
2628
//==============================================================================
2729
public override int Count => m_list.Count;
2830

31+
public override ActionData[] OptionActionList => new []
32+
{
33+
new ActionData( "コピー", () => GUIUtility.systemCopyBuffer = m_text ),
34+
};
35+
2936
//==============================================================================
3037
// 関数
3138
//==============================================================================
@@ -34,6 +41,8 @@ public class SimpleTextListDataCreator : ListCreatorBase<ActionData>
3441
/// </summary>
3542
public SimpleTextListDataCreator( string text )
3643
{
44+
m_text = text;
45+
3746
if ( string.IsNullOrWhiteSpace( text ) )
3847
{
3948
m_sourceList = new ActionData[ 0 ];

0 commit comments

Comments
 (0)