ball 项目提交
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UNSDK
|
||||
{
|
||||
public class ConfigEditor : EditorWindow
|
||||
{
|
||||
private static ConfigEditor _view;
|
||||
|
||||
[MenuItem("Tools/CreateConfig")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
if (_view != null)
|
||||
{
|
||||
CloseView();
|
||||
return;
|
||||
}
|
||||
_view = GetWindow<ConfigEditor>();
|
||||
_view.titleContent = new GUIContent("ConfigEditor");
|
||||
}
|
||||
|
||||
static void CloseView()
|
||||
{
|
||||
_view.Close();
|
||||
_view = null;
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
DrawWindow();
|
||||
EditorUtility.SetDirty(SdkConfigMgr.Instance);
|
||||
}
|
||||
|
||||
private void DrawWindow()
|
||||
{
|
||||
TextLabel("Sdk 配置",Color.white);
|
||||
EditorGUILayout.BeginVertical("frameBox");
|
||||
SdkConfigMgr.Instance.secret = EditorGUILayout.TextField("Secret", SdkConfigMgr.Instance.secret);
|
||||
SdkConfigMgr.Instance.host = EditorGUILayout.TextField("Host", SdkConfigMgr.Instance.host);
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
|
||||
TextLabel("Debug Log",Color.white);
|
||||
EditorGUILayout.BeginVertical("frameBox");
|
||||
SdkConfigMgr.Instance.isLog = EditorGUILayout.Toggle("IsLog", SdkConfigMgr.Instance.isLog);
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void TextLabel(string content, Color color = new Color())
|
||||
{
|
||||
if (color.Equals(Color.clear))
|
||||
{
|
||||
color = Color.gray;
|
||||
}
|
||||
GUIStyle style = new GUIStyle();
|
||||
style.contentOffset = new Vector2(8, 0);
|
||||
style.normal.textColor = color;
|
||||
style.fontSize = 14;
|
||||
style.padding = new RectOffset(0, 0, 3, 0);
|
||||
GUILayout.Label(content, style);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 68fcbeb7d5bbfbb4db4304eb591872db
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user