Merge branch 'master' of http://192.168.31.100:8088/framework/xosmopluginlibrary
This commit is contained in:
@@ -112,14 +112,6 @@ namespace Stary.Evo.Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// [Title("加密列表", titleAlignment: TitleAlignments.Centered)]
|
|
||||||
// [HorizontalGroup("BuildPipeline"), HideLabel]
|
|
||||||
// [ValueDropdown("GetEncryptionServices")]
|
|
||||||
// [OnValueChanged("SetEncryptionServices")]
|
|
||||||
// public Type encryption;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[HideLabel] public AbstractBuildPipelineViewer viewer;
|
[HideLabel] public AbstractBuildPipelineViewer viewer;
|
||||||
|
|
||||||
@@ -227,23 +219,6 @@ namespace Stary.Evo.Editor
|
|||||||
_viewers.Add(selectedBuildPipelines, viewer);
|
_viewers.Add(selectedBuildPipelines, viewer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// private List<Type> GetEncryptionServices()
|
|
||||||
// {
|
|
||||||
// var encryptionClassTypes = EditorTools.GetAssignableTypes(typeof(IEncryptionServices));
|
|
||||||
// if (encryption.IsNull())
|
|
||||||
// {
|
|
||||||
// encryption = encryptionClassTypes[0];
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return encryptionClassTypes;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private void SetEncryptionServices()
|
|
||||||
// {
|
|
||||||
// AssetBundleBuilderSetting.SetPackageEncyptionClassName(packageName, selectedBuildPipelines,
|
|
||||||
// encryption.FullName);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum VersionPosType
|
public enum VersionPosType
|
||||||
|
|||||||
@@ -211,7 +211,10 @@ namespace Stary.Evo.Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[TitleGroup("预览Domain作用域")] public List<CreatDomainEntity> domainList;
|
[TitleGroup("预览Domain作用域")]
|
||||||
|
[ListDrawerSettings(DraggableItems = false, ShowFoldout = false, ShowPaging = false, ShowItemCount = false,
|
||||||
|
HideRemoveButton = true,HideAddButton = true)]
|
||||||
|
public List<CreatDomainEntity> domainList;
|
||||||
|
|
||||||
protected override void Initialize()
|
protected override void Initialize()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace Stary.Evo.Editor
|
|||||||
public bool isOneKeyBuild;
|
public bool isOneKeyBuild;
|
||||||
|
|
||||||
[ListDrawerSettings(DraggableItems = false, ShowFoldout = false, ShowPaging = false, ShowItemCount = false,
|
[ListDrawerSettings(DraggableItems = false, ShowFoldout = false, ShowPaging = false, ShowItemCount = false,
|
||||||
HideRemoveButton = true)]
|
HideRemoveButton = true,HideAddButton = true)]
|
||||||
public List<OneKeyBuildEntity> OneKeyBuildEntities = new List<OneKeyBuildEntity>();
|
public List<OneKeyBuildEntity> OneKeyBuildEntities = new List<OneKeyBuildEntity>();
|
||||||
|
|
||||||
protected override void Initialize()
|
protected override void Initialize()
|
||||||
|
|||||||
@@ -18,7 +18,12 @@ namespace Stary.Evo
|
|||||||
|
|
||||||
static WebRequestSystem()
|
static WebRequestSystem()
|
||||||
{
|
{
|
||||||
|
#if UNITY_EDITOR
|
||||||
authorization = EditorPrefs.GetString("Authorization");
|
authorization = EditorPrefs.GetString("Authorization");
|
||||||
|
#else
|
||||||
|
authorization = PlayerPrefs.GetString("Authorization");
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<bool> Login(string url, string username, string password)
|
public static async Task<bool> Login(string url, string username, string password)
|
||||||
@@ -64,7 +69,12 @@ namespace Stary.Evo
|
|||||||
JsonConvert.DeserializeObject<AuthenticationResponse>(authResponse.data.ToString());
|
JsonConvert.DeserializeObject<AuthenticationResponse>(authResponse.data.ToString());
|
||||||
Debug.Log("UnityEvo:AuthenticationResponse" + authResponseData.Token);
|
Debug.Log("UnityEvo:AuthenticationResponse" + authResponseData.Token);
|
||||||
authorization = authResponseData.Token;
|
authorization = authResponseData.Token;
|
||||||
|
#if UNITY_EDITOR
|
||||||
EditorPrefs.SetString("Authorization", authorization);
|
EditorPrefs.SetString("Authorization", authorization);
|
||||||
|
#else
|
||||||
|
PlayerPrefs.SetString("Authorization",authorization);
|
||||||
|
#endif
|
||||||
|
|
||||||
Debug.Log("UnityEvo:登录成功");
|
Debug.Log("UnityEvo:登录成功");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -87,7 +97,11 @@ namespace Stary.Evo
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static async Task<bool> GetValidateToken(string url)
|
public static async Task<bool> GetValidateToken(string url)
|
||||||
{
|
{
|
||||||
|
#if UNITY_EDITOR
|
||||||
authorization = EditorPrefs.GetString("Authorization");
|
authorization = EditorPrefs.GetString("Authorization");
|
||||||
|
#else
|
||||||
|
authorization = PlayerPrefs.GetString("Authorization");
|
||||||
|
#endif
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -130,7 +144,7 @@ namespace Stary.Evo
|
|||||||
/// <param name="url">获取Token值的服务URL地址(很重要)</param>
|
/// <param name="url">获取Token值的服务URL地址(很重要)</param>
|
||||||
/// <param name="postData">传入请求的参数,此处参数为JOSN格式</param>
|
/// <param name="postData">传入请求的参数,此处参数为JOSN格式</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static async Task<ResultMessageEntity> PostFile(string url, string[] path)
|
public static async Task<ResultMessageEntity> PostFile(string url, string[] path,Action<float> uploadProgress = null)
|
||||||
{
|
{
|
||||||
if (!GetTokenState())
|
if (!GetTokenState())
|
||||||
{
|
{
|
||||||
@@ -160,7 +174,18 @@ namespace Stary.Evo
|
|||||||
webRequest.disposeDownloadHandlerOnDispose = true;
|
webRequest.disposeDownloadHandlerOnDispose = true;
|
||||||
webRequest.disposeCertificateHandlerOnDispose = true;
|
webRequest.disposeCertificateHandlerOnDispose = true;
|
||||||
webRequest.timeout = 60;
|
webRequest.timeout = 60;
|
||||||
await webRequest.SendWebRequest();
|
|
||||||
|
// 发送请求但不等待完成
|
||||||
|
var operation = webRequest.SendWebRequest();
|
||||||
|
// 轮询获取上传进度
|
||||||
|
while (!operation.isDone)
|
||||||
|
{
|
||||||
|
// 调用进度回调函数
|
||||||
|
uploadProgress?.Invoke(webRequest.uploadProgress);
|
||||||
|
// 等待一帧,避免阻塞
|
||||||
|
await UniTask.Yield();
|
||||||
|
}
|
||||||
|
|
||||||
webRequest.uploadHandler?.Dispose();
|
webRequest.uploadHandler?.Dispose();
|
||||||
// 更新错误检查方式
|
// 更新错误检查方式
|
||||||
if (webRequest.result == UnityWebRequest.Result.ConnectionError ||
|
if (webRequest.result == UnityWebRequest.Result.ConnectionError ||
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "com.staryevo.main",
|
"name": "com.staryevo.main",
|
||||||
"version": "2.0.7",
|
"version": "2.0.9",
|
||||||
"displayName": "00.StaryEvo",
|
"displayName": "00.StaryEvo",
|
||||||
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
||||||
"unity": "2021.3",
|
"unity": "2021.3",
|
||||||
|
|||||||
@@ -3,11 +3,9 @@ using System.IO;
|
|||||||
using Cysharp.Threading.Tasks;
|
using Cysharp.Threading.Tasks;
|
||||||
using Main;
|
using Main;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Stary.Evo.UIFarme;
|
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Assertions;
|
using UnityEngine.Assertions;
|
||||||
using UnityEngine.Networking;
|
|
||||||
using YooAsset;
|
using YooAsset;
|
||||||
using Object = UnityEngine.Object;
|
using Object = UnityEngine.Object;
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
using System;
|
|
||||||
using Cysharp.Threading.Tasks;
|
|
||||||
using Stary.Evo;
|
|
||||||
using Stary.Evo.AudioCore;
|
|
||||||
using Stary.Evo.InformationSave;
|
|
||||||
using Stary.Evo.UIFarme;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using YooAsset;
|
|
||||||
|
|
||||||
namespace Main
|
namespace Main
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 837b1c9b253d1a64d95fca965f70a711
|
guid: bd3da5461163cd64ab3441b4a74898b9
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: da2206dfe63228d4983a39725c0e940c
|
guid: 29ee4f712effada4496defa69962b37d
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -6,6 +7,7 @@ using UnityEngine.UI;
|
|||||||
#if HotUpdate
|
#if HotUpdate
|
||||||
using YooAsset;
|
using YooAsset;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Stary.Evo.UIFarme
|
namespace Stary.Evo.UIFarme
|
||||||
{
|
{
|
||||||
public interface IBasePanel : IController
|
public interface IBasePanel : IController
|
||||||
@@ -14,6 +16,7 @@ namespace Stary.Evo.UIFarme
|
|||||||
/// UI信息
|
/// UI信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
string UIName { get; set; }
|
string UIName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 绑定这个面板的实例
|
/// 绑定这个面板的实例
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -28,7 +31,7 @@ namespace Stary.Evo.UIFarme
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 虚方法,UI进入时执行的操作,只会执行一次
|
/// 虚方法,UI进入时执行的操作,只会执行一次
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void OnEnter();
|
void OnEnter(Action complete = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 虚方法,UI暂停时执行的操作,只会执行一次
|
/// 虚方法,UI暂停时执行的操作,只会执行一次
|
||||||
@@ -74,6 +77,8 @@ namespace Stary.Evo.UIFarme
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string UIName { get; set; }
|
public string UIName { get; set; }
|
||||||
|
|
||||||
|
public abstract UITweenType TweenType { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 面板管理器
|
/// 面板管理器
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -118,11 +123,27 @@ namespace Stary.Evo.UIFarme
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public virtual void OnEnter()
|
public virtual void OnEnter(Action complete = null)
|
||||||
{
|
{
|
||||||
activePanel.SetActive(true);
|
activePanel.SetActive(true);
|
||||||
canvasGroup.blocksRaycasts = true;
|
canvasGroup.blocksRaycasts = true;
|
||||||
canvasGroup.DOFade(1f, 1f);
|
if (TweenType == UITweenType.Fade)
|
||||||
|
{
|
||||||
|
canvasGroup.alpha = 1f;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TweenType == UITweenType.Fade)
|
||||||
|
{
|
||||||
|
canvasGroup.DOFade(1f, 2f).OnComplete(() => { complete?.Invoke(); });
|
||||||
|
}
|
||||||
|
else if (TweenType == UITweenType.Yoyo)
|
||||||
|
{
|
||||||
|
canvasGroup.DOFade(1, 2f).SetLoops(2, LoopType.Yoyo).OnComplete(() => { complete?.Invoke(); });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
canvasGroup.DOFade(1, 2f).SetLoops(-1).OnComplete(() => { complete?.Invoke(); });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void OnPause()
|
public virtual void OnPause()
|
||||||
@@ -169,15 +190,15 @@ namespace Stary.Evo.UIFarme
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var package = YooAssets.TryGetPackage(packageName);
|
var package = YooAssets.TryGetPackage(packageName);
|
||||||
if (package == null)
|
if (package == null)
|
||||||
{
|
{
|
||||||
handle = YooAssets.LoadAssetAsync<GameObject>(panelName);
|
handle = YooAssets.LoadAssetAsync<GameObject>(panelName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
handle = package.LoadAssetAsync<GameObject>(panelName);
|
handle = package.LoadAssetAsync<GameObject>(panelName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await handle.Task;
|
await handle.Task;
|
||||||
@@ -192,7 +213,7 @@ namespace Stary.Evo.UIFarme
|
|||||||
activePanel.name = this.GetType().Name;
|
activePanel.name = this.GetType().Name;
|
||||||
|
|
||||||
|
|
||||||
if (!activePanel.GetComponentInChildren<Canvas>() && !activePanel.GetComponentInParent<Canvas>())
|
if (!activePanel.GetComponentInChildren<Canvas>() && !activePanel.GetComponentInParent<Canvas>())
|
||||||
{
|
{
|
||||||
Debug.LogError($"UnityEvo:panelParent上不存在Canvas组件,{panelName}无法正常运行,进程已中断,请检查!!!!!");
|
Debug.LogError($"UnityEvo:panelParent上不存在Canvas组件,{panelName}无法正常运行,进程已中断,请检查!!!!!");
|
||||||
return null;
|
return null;
|
||||||
@@ -236,5 +257,28 @@ namespace Stary.Evo.UIFarme
|
|||||||
{
|
{
|
||||||
return PanelSystem.GetArchitecture();
|
return PanelSystem.GetArchitecture();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum UITweenType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 无动画
|
||||||
|
/// </summary>
|
||||||
|
None,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 淡入淡出
|
||||||
|
/// </summary>
|
||||||
|
Fade,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 循环播放
|
||||||
|
/// </summary>
|
||||||
|
Loop,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 往返播放
|
||||||
|
/// </summary>
|
||||||
|
Yoyo,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 5255d0f8bf44ff44c8ce65055fa5b28f
|
guid: 40f7e925262e7404ba3b4d8114a222b4
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 0a3652d3c1fe0e54c8d3253df95b811b
|
guid: ac2b1730cea60f24f9a45eb29d21306b
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
@@ -22,6 +22,7 @@ namespace Stary.Evo.UIFarme
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
void PopQueue<T>(string panelName=null) where T : IBasePanel, new();
|
void PopQueue<T>(string panelName=null) where T : IBasePanel, new();
|
||||||
|
|
||||||
|
void PopQueue<T>(T t, string panelName=null) where T : IBasePanel, new();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 执行面板的出栈操作,此操作会执行面板的OnExit方法
|
/// 执行面板的出栈操作,此操作会执行面板的OnExit方法
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -203,6 +204,11 @@ namespace Stary.Evo.UIFarme
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void PopQueue<T>(T t, string panelName = null) where T : IBasePanel, new()
|
||||||
|
{
|
||||||
|
PopQueue<T>(panelName);
|
||||||
|
}
|
||||||
|
|
||||||
public void PopStack()
|
public void PopStack()
|
||||||
{
|
{
|
||||||
if (stackPanel.Count > 0)
|
if (stackPanel.Count > 0)
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: dd370aabf636e1747a77b8071d92de0a
|
guid: fe94e5095f79a6e43b88b79996bb6907
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: ee00776e2fe511d418a91053db3d27fa
|
guid: b02fa06ef99a409438a3210be9148e0f
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 47109d36e16c5ff49b9d9c535cce542f
|
guid: daa3b3944e8c712488cb711a0f3f092b
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@@ -31,6 +31,8 @@ public class VideoPanel : BasePanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public override UITweenType TweenType => UITweenType.Fade;
|
||||||
|
|
||||||
public override void Initialize(GameObject panelGo)
|
public override void Initialize(GameObject panelGo)
|
||||||
{
|
{
|
||||||
base.Initialize(panelGo);
|
base.Initialize(panelGo);
|
||||||
@@ -43,9 +45,9 @@ public class VideoPanel : BasePanel
|
|||||||
_animator = area.GetComponentInChildren<Animator>();
|
_animator = area.GetComponentInChildren<Animator>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnEnter()
|
public override void OnEnter(Action complete = null)
|
||||||
{
|
{
|
||||||
base.OnEnter();
|
base.OnEnter(complete);
|
||||||
|
|
||||||
this.RegisterEvent<ModeType, VideoInfo>(ModeType.VideoStart, OnStartMove);
|
this.RegisterEvent<ModeType, VideoInfo>(ModeType.VideoStart, OnStartMove);
|
||||||
this.RegisterEvent<ModeType>(ModeType.VideoEnd, OnStopMove);
|
this.RegisterEvent<ModeType>(ModeType.VideoEnd, OnStopMove);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "com.staryevo.tools",
|
"name": "com.staryevo.tools",
|
||||||
"version": "1.1.0",
|
"version": "1.1.3",
|
||||||
"displayName": "00.StaryEvo.Tools",
|
"displayName": "00.StaryEvo.Tools",
|
||||||
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
||||||
"unity": "2021.3",
|
"unity": "2021.3",
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class UICreateWindow : EditorWindow
|
|||||||
{
|
{
|
||||||
#region MenuItem
|
#region MenuItem
|
||||||
|
|
||||||
[MenuItem("Assets/Evo/UI工具/CreateUI")]
|
[MenuItem("Evo/UI管理/CreateUI")]
|
||||||
private static void CopyUI()
|
private static void CopyUI()
|
||||||
{
|
{
|
||||||
if (Selection.activeObject == null || !(Selection.activeObject is GameObject))
|
if (Selection.activeObject == null || !(Selection.activeObject is GameObject))
|
||||||
@@ -27,7 +27,7 @@ public class UICreateWindow : EditorWindow
|
|||||||
UICreateWindow.OpenWindow().uiPrefab = Selection.activeObject as GameObject;
|
UICreateWindow.OpenWindow().uiPrefab = Selection.activeObject as GameObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
[MenuItem("Evo/UI管理")]
|
[MenuItem("Evo/UI管理/OpenWindow")]
|
||||||
public static UICreateWindow OpenWindow()
|
public static UICreateWindow OpenWindow()
|
||||||
{
|
{
|
||||||
var window = GetWindow<UICreateWindow>("UI管理");
|
var window = GetWindow<UICreateWindow>("UI管理");
|
||||||
@@ -51,6 +51,7 @@ public class UICreateWindow : EditorWindow
|
|||||||
private string _uiViewTemplate = "UIViewTemplate";
|
private string _uiViewTemplate = "UIViewTemplate";
|
||||||
private string _uiConfig = "UIConfig";
|
private string _uiConfig = "UIConfig";
|
||||||
private string _uiName;
|
private string _uiName;
|
||||||
|
private string _saveUIPath;
|
||||||
public GameObject uiPrefab;
|
public GameObject uiPrefab;
|
||||||
private Dictionary<string, string> _uiNames = new Dictionary<string, string>();
|
private Dictionary<string, string> _uiNames = new Dictionary<string, string>();
|
||||||
private Dictionary<string, UIConfigJson> _uiJsonDatas = new Dictionary<string, UIConfigJson>();
|
private Dictionary<string, UIConfigJson> _uiJsonDatas = new Dictionary<string, UIConfigJson>();
|
||||||
@@ -77,6 +78,7 @@ public class UICreateWindow : EditorWindow
|
|||||||
_uiJsonDatas.Clear();
|
_uiJsonDatas.Clear();
|
||||||
_uiNames.Clear();
|
_uiNames.Clear();
|
||||||
uiViews = ReflectionHelper.GetAllUIViewTypes(_domainNames[_domainIndex]);
|
uiViews = ReflectionHelper.GetAllUIViewTypes(_domainNames[_domainIndex]);
|
||||||
|
_saveUIPath = EditorPrefs.GetString(nameof(_saveUIPath));
|
||||||
DomainPathField();
|
DomainPathField();
|
||||||
foreach (var uiView in uiViews)
|
foreach (var uiView in uiViews)
|
||||||
{
|
{
|
||||||
@@ -89,6 +91,7 @@ public class UICreateWindow : EditorWindow
|
|||||||
_uiNames.AddOrUpdate(str, scriptPath);
|
_uiNames.AddOrUpdate(str, scriptPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnGUI()
|
private void OnGUI()
|
||||||
{
|
{
|
||||||
EditorGUILayout.LabelField("通过[Evo/UI管理]可以打开");
|
EditorGUILayout.LabelField("通过[Evo/UI管理]可以打开");
|
||||||
@@ -106,12 +109,13 @@ public class UICreateWindow : EditorWindow
|
|||||||
{
|
{
|
||||||
_scroll2 = EditorGUILayout.BeginScrollView(_scroll2, "box", GUILayout.Width(position.width * 0.4f - 6));
|
_scroll2 = EditorGUILayout.BeginScrollView(_scroll2, "box", GUILayout.Width(position.width * 0.4f - 6));
|
||||||
{
|
{
|
||||||
var tempIndex =EditorGUILayout.Popup("Domain", _domainIndex, _domainNames);
|
var tempIndex = EditorGUILayout.Popup("Domain", _domainIndex, _domainNames);
|
||||||
if (tempIndex != _domainIndex)
|
if (tempIndex != _domainIndex)
|
||||||
{
|
{
|
||||||
ValueChang();
|
ValueChang();
|
||||||
_domainIndex = tempIndex;
|
_domainIndex = tempIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorGUILayout.HelpBox("已创建的UI", MessageType.Info);
|
EditorGUILayout.HelpBox("已创建的UI", MessageType.Info);
|
||||||
_mInput = EditorGUILayout.TextField(_mInput, EditorStyles.toolbarSearchField, GUILayout.Height(20));
|
_mInput = EditorGUILayout.TextField(_mInput, EditorStyles.toolbarSearchField, GUILayout.Height(20));
|
||||||
|
|
||||||
@@ -127,6 +131,7 @@ public class UICreateWindow : EditorWindow
|
|||||||
{
|
{
|
||||||
jsonData = new UIConfigJson();
|
jsonData = new UIConfigJson();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(scriptPath)) continue;
|
if (string.IsNullOrEmpty(scriptPath)) continue;
|
||||||
|
|
||||||
var defaultColor = GUI.color;
|
var defaultColor = GUI.color;
|
||||||
@@ -160,16 +165,21 @@ public class UICreateWindow : EditorWindow
|
|||||||
var uiScriptPath = GetUIScript(_uiName);
|
var uiScriptPath = GetUIScript(_uiName);
|
||||||
if (string.IsNullOrEmpty(uiScriptPath))
|
if (string.IsNullOrEmpty(uiScriptPath))
|
||||||
{
|
{
|
||||||
var saveUIPath= $"Assets/Domain/{_domainNames[_domainIndex]}/Scripts/UI";
|
if (string.IsNullOrEmpty(_saveUIPath))
|
||||||
if (GUILayout.Button($"选择创建路径:{saveUIPath}"))
|
|
||||||
{
|
{
|
||||||
var newPath = EditorUtility.OpenFolderPanel("UI生成路径", saveUIPath, "");
|
_saveUIPath = $"Assets/Domain/{_domainNames[_domainIndex]}/HotUpdate/UI";
|
||||||
saveUIPath = newPath.Replace(Application.dataPath, "Assets");
|
}
|
||||||
|
|
||||||
|
if (GUILayout.Button($"选择创建路径:{_saveUIPath}"))
|
||||||
|
{
|
||||||
|
var newPath = EditorUtility.OpenFolderPanel("UI生成路径", _saveUIPath, "");
|
||||||
|
_saveUIPath = newPath.Replace(Application.dataPath, "Assets");
|
||||||
|
EditorPrefs.SetString(nameof(_saveUIPath), _saveUIPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uiPrefab != null)
|
if (uiPrefab != null)
|
||||||
{
|
{
|
||||||
EditorGUILayout.TextField("UI生成路径", $"{saveUIPath}/{_uiName}.cs");
|
EditorGUILayout.TextField("UI生成路径", $"{_saveUIPath}/{_uiName}.cs");
|
||||||
}
|
}
|
||||||
|
|
||||||
_isWindow = EditorGUILayout.Toggle("是否为窗口", _isWindow);
|
_isWindow = EditorGUILayout.Toggle("是否为窗口", _isWindow);
|
||||||
@@ -189,7 +199,7 @@ public class UICreateWindow : EditorWindow
|
|||||||
|
|
||||||
str = Regex.Replace(str, "//UIControlData",
|
str = Regex.Replace(str, "//UIControlData",
|
||||||
uiControlData != null ? UnityEngine.GUIUtility.systemCopyBuffer : "");
|
uiControlData != null ? UnityEngine.GUIUtility.systemCopyBuffer : "");
|
||||||
string newPath = $"{saveUIPath}/{_uiName}.cs";
|
string newPath = $"{_saveUIPath}/{_uiName}.cs";
|
||||||
File.WriteAllText(newPath, str);
|
File.WriteAllText(newPath, str);
|
||||||
|
|
||||||
var jsonData = new UIConfigJson
|
var jsonData = new UIConfigJson
|
||||||
@@ -227,6 +237,7 @@ public class UICreateWindow : EditorWindow
|
|||||||
jsonData.uiType = _uiName;
|
jsonData.uiType = _uiName;
|
||||||
_uiJsonDatas.AddOrUpdate(_uiName, jsonData);
|
_uiJsonDatas.AddOrUpdate(_uiName, jsonData);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UnityEditor.PrefabUtility.IsPartOfPrefabAsset(uiPrefab))
|
if (UnityEditor.PrefabUtility.IsPartOfPrefabAsset(uiPrefab))
|
||||||
{
|
{
|
||||||
// 预制体资源就是自身
|
// 预制体资源就是自身
|
||||||
@@ -335,7 +346,7 @@ public class UICreateWindow : EditorWindow
|
|||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (GetUIJson(name) == null) return string.Empty;
|
// if (GetUIJson(name) == null) return string.Empty;
|
||||||
|
|
||||||
string[] ids = AssetDatabase.FindAssets(name);
|
string[] ids = AssetDatabase.FindAssets(name);
|
||||||
if (ids != null)
|
if (ids != null)
|
||||||
@@ -438,6 +449,7 @@ static class ReflectionHelper
|
|||||||
Debug.LogError($"未找到名为HotUpdate_{domainName}的程序集");
|
Debug.LogError($"未找到名为HotUpdate_{domainName}的程序集");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
result.AddRange(targetAssembly.GetTypes()
|
result.AddRange(targetAssembly.GetTypes()
|
||||||
@@ -465,7 +477,4 @@ static class ReflectionHelper
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 125226ccd07f47c5bf3b94157bf12fc3
|
|
||||||
timeCreated: 1758179120
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "com.staryevo.uifarme",
|
"name": "com.staryevo.uifarme",
|
||||||
"displayName": "06.UIFarme",
|
"displayName": "06.UIFarme",
|
||||||
"version": "2.0.1",
|
"version": "2.0.4",
|
||||||
"description": "UI框架工具",
|
"description": "UI框架工具",
|
||||||
"unity": "2021.3",
|
"unity": "2021.3",
|
||||||
"unityRelease": "30f1",
|
"unityRelease": "30f1",
|
||||||
|
|||||||
@@ -49,6 +49,6 @@ MonoBehaviour:
|
|||||||
deAudioEnabled: 0
|
deAudioEnabled: 0
|
||||||
deUnityExtendedEnabled: 0
|
deUnityExtendedEnabled: 0
|
||||||
epoOutlineEnabled: 0
|
epoOutlineEnabled: 0
|
||||||
createASMDEF: 0
|
createASMDEF: 1
|
||||||
showPlayingTweens: 0
|
showPlayingTweens: 0
|
||||||
showPausedTweens: 0
|
showPausedTweens: 0
|
||||||
|
|||||||
25
Assets/Resources/HotfixMainResDomain.asset
Normal file
25
Assets/Resources/HotfixMainResDomain.asset
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
%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: 1a78aa2541a743f89b2646efe4073f01, type: 3}
|
||||||
|
m_Name: HotfixMainResDomain
|
||||||
|
m_EditorClassIdentifier: com.stary.evo.runtime:Stary.Evo:HotfixMainResDomain
|
||||||
|
hotfixMainResDomainEntity:
|
||||||
|
ipconfig: http://192.168.31.67:9527
|
||||||
|
mainDomainVersion:
|
||||||
|
username: admin2023
|
||||||
|
password: admin@2023
|
||||||
|
projectInfo:
|
||||||
|
projectName:
|
||||||
|
projectCode:
|
||||||
|
projectPackageName: com.xosmo.
|
||||||
|
loadingScene: {fileID: 0}
|
||||||
|
loadingScenePath:
|
||||||
8
Assets/Resources/HotfixMainResDomain.asset.meta
Normal file
8
Assets/Resources/HotfixMainResDomain.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: baae28693819e9642b1bb2f800ecce11
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
16
Assets/Resources/YooAssetSettings.asset
Normal file
16
Assets/Resources/YooAssetSettings.asset
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
%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: 5bd1afdce9715f84eb4cbc901922afc2, type: 3}
|
||||||
|
m_Name: YooAssetSettings
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
DefaultYooFolderName: xosmoRes
|
||||||
|
PackageManifestPrefix:
|
||||||
8
Assets/Resources/YooAssetSettings.asset.meta
Normal file
8
Assets/Resources/YooAssetSettings.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: eb7c33b4b4bdc2c4c8a7fe94c23ad152
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Reference in New Issue
Block a user