-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
555 additions
and
42 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace HT.Framework | ||
{ | ||
/// <summary> | ||
/// 管理员身份登录窗口 | ||
/// </summary> | ||
public sealed class AdminLoginWindow : HTFEditorWindow | ||
{ | ||
public static void OpenWindow(IAdminLoginWindow parent) | ||
{ | ||
AdminLoginWindow window = GetWindow<AdminLoginWindow>(); | ||
window._parent = parent; | ||
window.titleContent.text = "Admin Login"; | ||
window.minSize = new Vector2(250, 50); | ||
window.maxSize = new Vector2(250, 50); | ||
window.Show(); | ||
} | ||
|
||
private IAdminLoginWindow _parent; | ||
private string _password = ""; | ||
|
||
protected override bool IsEnableTitleGUI | ||
{ | ||
get | ||
{ | ||
return false; | ||
} | ||
} | ||
|
||
protected override void OnBodyGUI() | ||
{ | ||
base.OnBodyGUI(); | ||
|
||
EventHandle(); | ||
|
||
GUILayout.BeginVertical(); | ||
GUILayout.FlexibleSpace(); | ||
GUILayout.BeginHorizontal(); | ||
GUILayout.FlexibleSpace(); | ||
|
||
GUILayout.Label("Password:"); | ||
_password = EditorGUILayout.PasswordField(_password, GUILayout.Width(100)); | ||
GUI.enabled = _password != ""; | ||
if (GUILayout.Button("Login", EditorStyles.miniButton)) | ||
{ | ||
_parent.AdminCheck(_password); | ||
Close(); | ||
} | ||
GUI.enabled = true; | ||
|
||
GUILayout.FlexibleSpace(); | ||
GUILayout.EndHorizontal(); | ||
GUILayout.FlexibleSpace(); | ||
GUILayout.EndVertical(); | ||
} | ||
|
||
private void EventHandle() | ||
{ | ||
if (Event.current == null) | ||
{ | ||
return; | ||
} | ||
|
||
switch (Event.current.rawType) | ||
{ | ||
case EventType.KeyDown: | ||
switch (Event.current.keyCode) | ||
{ | ||
case KeyCode.Return: | ||
case KeyCode.KeypadEnter: | ||
if (_password != "") | ||
{ | ||
_parent.AdminCheck(_password); | ||
Close(); | ||
} | ||
break; | ||
} | ||
break; | ||
} | ||
} | ||
|
||
private void Update() | ||
{ | ||
if (_parent == null) | ||
{ | ||
Close(); | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace HT.Framework | ||
{ | ||
/// <summary> | ||
/// 拥有管理员模式的窗口 | ||
/// </summary> | ||
public interface IAdminLoginWindow | ||
{ | ||
/// <summary> | ||
/// 是否是管理员模式 | ||
/// </summary> | ||
bool IsAdminMode { get; set; } | ||
/// <summary> | ||
/// 管理员密码 | ||
/// </summary> | ||
string Password { get; } | ||
|
||
/// <summary> | ||
/// 管理员身份验证 | ||
/// </summary> | ||
/// <param name="password">密码</param> | ||
void AdminCheck(string password); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
Editor/Utility/Config/Config.ini.meta → Editor/Utility/Version.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &11400000 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: 5a9413c23c0c1ee459c00a34641d7fab, type: 3} | ||
m_Name: Version | ||
m_EditorClassIdentifier: | ||
CurrentVersion: | ||
MajorNumber: 0 | ||
MinorNumber: 1 | ||
ReviseNumber: 0 | ||
ReleaseNotes: "1.\u53D1\u884C\u7684\u7B2C\u4E00\u4E2A\u7A33\u5B9A\u7248\u3002\r\n\u98CE\u534E\u7EDD\u4EE3\u548C\u7FFB\u6C5F\u5012\u6D77\u53D1\u5EFA\u534E\u5927\u8857\r\n\u5C31\u770B\u5F97\u89C1\u98DE\r\n\u5C31\u770B\u5F97\u89C1\u98DE\r\n\u5C31\u770B\u5F97\u89C1\u98DE\r\n\u5C31\u770B\u5F97\u89C1\u98DE\r\n\u5C31\u770B\u5F97\u89C1\u98DE\r\n\u5C31\u770B\u5F97\u89C1\u98DE\r\n\u5C31\u770B\u5F97\u89C1\u98DE\r\n\u5C31\u770B\u5F97\u89C1\u98DE\r\n\u5C31\u770B\u5F97\u89C1\u98DE" | ||
Platforms: 010000000200000003000000 | ||
UnityVersions: 2018.3.0 or higher | ||
ScriptingVersions: .NET 4.x Equivalent | ||
APIVersions: .NET 4.x | ||
PreviousVersions: | ||
- MajorNumber: 0 | ||
MinorNumber: 1 | ||
ReviseNumber: 2 | ||
ReleaseNotes: "11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n0" | ||
Platforms: | ||
UnityVersions: | ||
ScriptingVersions: | ||
APIVersions: | ||
- MajorNumber: 0 | ||
MinorNumber: 1 | ||
ReviseNumber: 3 | ||
ReleaseNotes: "11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n1" | ||
Platforms: | ||
UnityVersions: | ||
ScriptingVersions: | ||
APIVersions: | ||
- MajorNumber: 0 | ||
MinorNumber: 1 | ||
ReviseNumber: 4 | ||
ReleaseNotes: "11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n11111111111111111111111\r\n1111111111111111111111111111\r\n111111111111111111111111111111\r\n2" | ||
Platforms: | ||
UnityVersions: | ||
ScriptingVersions: | ||
APIVersions: |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.