This commit is contained in:
2025-10-15 12:11:12 +08:00
27 changed files with 190 additions and 81 deletions

View File

@@ -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;
@@ -227,23 +219,6 @@ namespace Stary.Evo.Editor
_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

View File

@@ -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()
{

View File

@@ -33,7 +33,7 @@ namespace Stary.Evo.Editor
public bool isOneKeyBuild;
[ListDrawerSettings(DraggableItems = false, ShowFoldout = false, ShowPaging = false, ShowItemCount = false,
HideRemoveButton = true)]
HideRemoveButton = true,HideAddButton = true)]
public List<OneKeyBuildEntity> OneKeyBuildEntities = new List<OneKeyBuildEntity>();
protected override void Initialize()

View File

@@ -18,7 +18,12 @@ namespace Stary.Evo
static WebRequestSystem()
{
#if UNITY_EDITOR
authorization = EditorPrefs.GetString("Authorization");
#else
authorization = PlayerPrefs.GetString("Authorization");
#endif
}
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());
Debug.Log("UnityEvo:AuthenticationResponse" + authResponseData.Token);
authorization = authResponseData.Token;
#if UNITY_EDITOR
EditorPrefs.SetString("Authorization", authorization);
#else
PlayerPrefs.SetString("Authorization",authorization);
#endif
Debug.Log("UnityEvo:登录成功");
return true;
}
@@ -87,7 +97,11 @@ namespace Stary.Evo
/// <returns></returns>
public static async Task<bool> GetValidateToken(string url)
{
#if UNITY_EDITOR
authorization = EditorPrefs.GetString("Authorization");
#else
authorization = PlayerPrefs.GetString("Authorization");
#endif
try
{
@@ -130,7 +144,7 @@ namespace Stary.Evo
/// <param name="url">获取Token值的服务URL地址很重要</param>
/// <param name="postData">传入请求的参数此处参数为JOSN格式</param>
/// <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())
{
@@ -160,7 +174,18 @@ namespace Stary.Evo
webRequest.disposeDownloadHandlerOnDispose = true;
webRequest.disposeCertificateHandlerOnDispose = true;
webRequest.timeout = 60;
await webRequest.SendWebRequest();
// 发送请求但不等待完成
var operation = webRequest.SendWebRequest();
// 轮询获取上传进度
while (!operation.isDone)
{
// 调用进度回调函数
uploadProgress?.Invoke(webRequest.uploadProgress);
// 等待一帧,避免阻塞
await UniTask.Yield();
}
webRequest.uploadHandler?.Dispose();
// 更新错误检查方式
if (webRequest.result == UnityWebRequest.Result.ConnectionError ||

View File

@@ -1,6 +1,6 @@
{
"name": "com.staryevo.main",
"version": "2.0.7",
"version": "2.0.9",
"displayName": "00.StaryEvo",
"description": "This is an Framework package(后台服务器版本端口9527)",
"unity": "2021.3",

View File

@@ -3,11 +3,9 @@ using System.IO;
using Cysharp.Threading.Tasks;
using Main;
using Newtonsoft.Json;
using Stary.Evo.UIFarme;
using UnityEditor;
using UnityEngine;
using UnityEngine.Assertions;
using UnityEngine.Networking;
using YooAsset;
using Object = UnityEngine.Object;

View File

@@ -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.UI;
using YooAsset;
namespace Main
{

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 837b1c9b253d1a64d95fca965f70a711
guid: bd3da5461163cd64ab3441b4a74898b9
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: da2206dfe63228d4983a39725c0e940c
guid: 29ee4f712effada4496defa69962b37d
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using DG.Tweening;
using UnityEngine;
@@ -6,6 +7,7 @@ using UnityEngine.UI;
#if HotUpdate
using YooAsset;
#endif
namespace Stary.Evo.UIFarme
{
public interface IBasePanel : IController
@@ -14,6 +16,7 @@ namespace Stary.Evo.UIFarme
/// UI信息
/// </summary>
string UIName { get; set; }
/// <summary>
/// 绑定这个面板的实例
/// </summary>
@@ -28,7 +31,7 @@ namespace Stary.Evo.UIFarme
/// <summary>
/// 虚方法UI进入时执行的操作只会执行一次
/// </summary>
void OnEnter();
void OnEnter(Action complete = null);
/// <summary>
/// 虚方法UI暂停时执行的操作只会执行一次
@@ -74,6 +77,8 @@ namespace Stary.Evo.UIFarme
/// </summary>
public string UIName { get; set; }
public abstract UITweenType TweenType { get; }
/// <summary>
/// 面板管理器
/// </summary>
@@ -118,11 +123,27 @@ namespace Stary.Evo.UIFarme
}
public virtual void OnEnter()
public virtual void OnEnter(Action complete = null)
{
activePanel.SetActive(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()
@@ -169,15 +190,15 @@ namespace Stary.Evo.UIFarme
}
else
{
var package = YooAssets.TryGetPackage(packageName);
if (package == null)
{
handle = YooAssets.LoadAssetAsync<GameObject>(panelName);
}
else
{
handle = package.LoadAssetAsync<GameObject>(panelName);
}
var package = YooAssets.TryGetPackage(packageName);
if (package == null)
{
handle = YooAssets.LoadAssetAsync<GameObject>(panelName);
}
else
{
handle = package.LoadAssetAsync<GameObject>(panelName);
}
}
await handle.Task;
@@ -192,7 +213,7 @@ namespace Stary.Evo.UIFarme
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}无法正常运行,进程已中断,请检查!!!!!");
return null;
@@ -236,5 +257,28 @@ namespace Stary.Evo.UIFarme
{
return PanelSystem.GetArchitecture();
}
public enum UITweenType
{
/// <summary>
/// 无动画
/// </summary>
None,
/// <summary>
/// 淡入淡出
/// </summary>
Fade,
/// <summary>
/// 循环播放
/// </summary>
Loop,
/// <summary>
/// 往返播放
/// </summary>
Yoyo,
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5255d0f8bf44ff44c8ce65055fa5b28f
guid: 40f7e925262e7404ba3b4d8114a222b4
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0a3652d3c1fe0e54c8d3253df95b811b
guid: ac2b1730cea60f24f9a45eb29d21306b
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -22,6 +22,7 @@ namespace Stary.Evo.UIFarme
/// </summary>
void PopQueue<T>(string panelName=null) where T : IBasePanel, new();
void PopQueue<T>(T t, string panelName=null) where T : IBasePanel, new();
/// <summary>
/// 执行面板的出栈操作此操作会执行面板的OnExit方法
/// </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()
{
if (stackPanel.Count > 0)

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: dd370aabf636e1747a77b8071d92de0a
guid: fe94e5095f79a6e43b88b79996bb6907
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ee00776e2fe511d418a91053db3d27fa
guid: b02fa06ef99a409438a3210be9148e0f
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 47109d36e16c5ff49b9d9c535cce542f
guid: daa3b3944e8c712488cb711a0f3f092b
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -31,6 +31,8 @@ public class VideoPanel : BasePanel
}
public override UITweenType TweenType => UITweenType.Fade;
public override void Initialize(GameObject panelGo)
{
base.Initialize(panelGo);
@@ -43,9 +45,9 @@ public class VideoPanel : BasePanel
_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>(ModeType.VideoEnd, OnStopMove);

View File

@@ -1,6 +1,6 @@
{
"name": "com.staryevo.tools",
"version": "1.1.0",
"version": "1.1.3",
"displayName": "00.StaryEvo.Tools",
"description": "This is an Framework package(后台服务器版本端口9527)",
"unity": "2021.3",

View File

@@ -15,7 +15,7 @@ public class UICreateWindow : EditorWindow
{
#region MenuItem
[MenuItem("Assets/Evo/UI工具/CreateUI")]
[MenuItem("Evo/UI管理/CreateUI")]
private static void CopyUI()
{
if (Selection.activeObject == null || !(Selection.activeObject is GameObject))
@@ -27,7 +27,7 @@ public class UICreateWindow : EditorWindow
UICreateWindow.OpenWindow().uiPrefab = Selection.activeObject as GameObject;
}
[MenuItem("Evo/UI管理")]
[MenuItem("Evo/UI管理/OpenWindow")]
public static UICreateWindow OpenWindow()
{
var window = GetWindow<UICreateWindow>("UI管理");
@@ -51,6 +51,7 @@ public class UICreateWindow : EditorWindow
private string _uiViewTemplate = "UIViewTemplate";
private string _uiConfig = "UIConfig";
private string _uiName;
private string _saveUIPath;
public GameObject uiPrefab;
private Dictionary<string, string> _uiNames = new Dictionary<string, string>();
private Dictionary<string, UIConfigJson> _uiJsonDatas = new Dictionary<string, UIConfigJson>();
@@ -77,6 +78,7 @@ public class UICreateWindow : EditorWindow
_uiJsonDatas.Clear();
_uiNames.Clear();
uiViews = ReflectionHelper.GetAllUIViewTypes(_domainNames[_domainIndex]);
_saveUIPath = EditorPrefs.GetString(nameof(_saveUIPath));
DomainPathField();
foreach (var uiView in uiViews)
{
@@ -89,6 +91,7 @@ public class UICreateWindow : EditorWindow
_uiNames.AddOrUpdate(str, scriptPath);
}
}
private void OnGUI()
{
EditorGUILayout.LabelField("通过[Evo/UI管理]可以打开");
@@ -106,12 +109,13 @@ public class UICreateWindow : EditorWindow
{
_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)
{
ValueChang();
_domainIndex = tempIndex;
}
EditorGUILayout.HelpBox("已创建的UI", MessageType.Info);
_mInput = EditorGUILayout.TextField(_mInput, EditorStyles.toolbarSearchField, GUILayout.Height(20));
@@ -127,6 +131,7 @@ public class UICreateWindow : EditorWindow
{
jsonData = new UIConfigJson();
}
if (string.IsNullOrEmpty(scriptPath)) continue;
var defaultColor = GUI.color;
@@ -160,16 +165,21 @@ public class UICreateWindow : EditorWindow
var uiScriptPath = GetUIScript(_uiName);
if (string.IsNullOrEmpty(uiScriptPath))
{
var saveUIPath= $"Assets/Domain/{_domainNames[_domainIndex]}/Scripts/UI";
if (GUILayout.Button($"选择创建路径:{saveUIPath}"))
if (string.IsNullOrEmpty(_saveUIPath))
{
var newPath = EditorUtility.OpenFolderPanel("UI生成路径", saveUIPath, "");
saveUIPath = newPath.Replace(Application.dataPath, "Assets");
_saveUIPath = $"Assets/Domain/{_domainNames[_domainIndex]}/HotUpdate/UI";
}
if (GUILayout.Button($"选择创建路径:{_saveUIPath}"))
{
var newPath = EditorUtility.OpenFolderPanel("UI生成路径", _saveUIPath, "");
_saveUIPath = newPath.Replace(Application.dataPath, "Assets");
EditorPrefs.SetString(nameof(_saveUIPath), _saveUIPath);
}
if (uiPrefab != null)
{
EditorGUILayout.TextField("UI生成路径", $"{saveUIPath}/{_uiName}.cs");
EditorGUILayout.TextField("UI生成路径", $"{_saveUIPath}/{_uiName}.cs");
}
_isWindow = EditorGUILayout.Toggle("是否为窗口", _isWindow);
@@ -189,7 +199,7 @@ public class UICreateWindow : EditorWindow
str = Regex.Replace(str, "//UIControlData",
uiControlData != null ? UnityEngine.GUIUtility.systemCopyBuffer : "");
string newPath = $"{saveUIPath}/{_uiName}.cs";
string newPath = $"{_saveUIPath}/{_uiName}.cs";
File.WriteAllText(newPath, str);
var jsonData = new UIConfigJson
@@ -227,6 +237,7 @@ public class UICreateWindow : EditorWindow
jsonData.uiType = _uiName;
_uiJsonDatas.AddOrUpdate(_uiName, jsonData);
}
if (UnityEditor.PrefabUtility.IsPartOfPrefabAsset(uiPrefab))
{
// 预制体资源就是自身
@@ -335,7 +346,7 @@ public class UICreateWindow : EditorWindow
return string.Empty;
}
// if (GetUIJson(name) == null) return string.Empty;
// if (GetUIJson(name) == null) return string.Empty;
string[] ids = AssetDatabase.FindAssets(name);
if (ids != null)
@@ -438,6 +449,7 @@ static class ReflectionHelper
Debug.LogError($"未找到名为HotUpdate_{domainName}的程序集");
return null;
}
try
{
result.AddRange(targetAssembly.GetTypes()
@@ -465,7 +477,4 @@ static class ReflectionHelper
return result;
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 125226ccd07f47c5bf3b94157bf12fc3
timeCreated: 1758179120

View File

@@ -1,7 +1,7 @@
{
"name": "com.staryevo.uifarme",
"displayName": "06.UIFarme",
"version": "2.0.1",
"version": "2.0.4",
"description": "UI框架工具",
"unity": "2021.3",
"unityRelease": "30f1",

View File

@@ -49,6 +49,6 @@ MonoBehaviour:
deAudioEnabled: 0
deUnityExtendedEnabled: 0
epoOutlineEnabled: 0
createASMDEF: 0
createASMDEF: 1
showPlayingTweens: 0
showPausedTweens: 0

View 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:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: baae28693819e9642b1bb2f800ecce11
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View 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:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: eb7c33b4b4bdc2c4c8a7fe94c23ad152
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant: