提交 bfa3d824 编写于 作者: 魔术师Dix's avatar 魔术师Dix

【Feature】添加路径选择面板控件;

上级 7974fe39
......@@ -12,6 +12,7 @@ using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UpmGitTool.UI;
namespace UpmGitTool
{
......@@ -24,7 +25,6 @@ namespace UpmGitTool
[LabelText("全局设置")]
public AppSetting Setting;
public void Start()
{
//本身是纯UI的工具,不需要高帧率,降低帧率以节约性能;
......@@ -37,12 +37,27 @@ namespace UpmGitTool
AppState.Path_NodeJsExe = NodeJsPath;
AppState.Path_WorkingDirectory = WorkingDirectory;
#endif
CheckPath();
GYEventsCenter.RegisterEventMsg(Lib.ON_ADD_GIT_FETCH_REQ, OnAddGitFetchReq);
StartCoroutine(AutoReadFeatchResult());
}
private void CheckPath()
{
if (!string.IsNullOrEmpty(AppState.Path_FetchJsCmd) &&
!string.IsNullOrEmpty(AppState.Path_NodeJsExe) &&
!string.IsNullOrEmpty(AppState.Path_WorkingDirectory))
return;
//表示此时存在空路径
UIManager.Instance.OpenWindow(E_WindowType.PathSelectWindow);
}
#if UNITY_EDITOR
[LabelText("Node.exe路径")]
......
......@@ -24,5 +24,8 @@ namespace UpmGitTool.UI
[LabelText("安装面板")]
InstallWindow,
[LabelText("路径选择面板")]
PathSelectWindow
}
}
\ No newline at end of file
/*
*Copyright(C) 2023 by Cocklebur All rights reserved.
*Unity版本:2022.2.1f1c1
*作者:Chief
*创建日期: 2023-02-14
*模块说明:UI面板
*版本: 1.0
*/
using Sirenix.OdinInspector;
using UnityEngine.UI;
namespace UpmGitTool.UI
{
/// <summary>
/// 路径选择面板
/// </summary>
public class PathSelectWindow : UIWindow
{
public override E_WindowType WindowType => E_WindowType.PathSelectWindow;
[LabelText("NodeJs路径")]
public UICtrl_PathSelect Path_NodeJs;
[LabelText("JS命令路径")]
public UICtrl_PathSelect Path_JsFetch;
[LabelText("工作目录")]
public UICtrl_PathSelect Path_FetchResult;
[LabelText("确认目录")]
public Button BtnConfrim;
protected override void OnOpen()
{
if (BtnConfrim != null)
{
BtnConfrim.onClick.AddListener(OnConfrim);
BtnConfrim.gameObject.SetActive(false);
}
}
private void OnConfrim()
{
//保存资源,并检测合法性;
}
protected override void OnClose()
{
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: d6127249471b2694899dd4b9ad398ad1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册