diff --git a/Assets/00.StaryEvo/Editor/BuildAsset/BuildAssetWindow.cs b/Assets/00.StaryEvo/Editor/BuildAsset/BuildAssetWindow.cs
index 15a6443..0385113 100644
--- a/Assets/00.StaryEvo/Editor/BuildAsset/BuildAssetWindow.cs
+++ b/Assets/00.StaryEvo/Editor/BuildAsset/BuildAssetWindow.cs
@@ -9,6 +9,7 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.IO.Compression;
using System.Linq;
using EditorFramework;
using HybridCLR.Editor;
@@ -28,7 +29,6 @@ namespace Stary.Evo.Editor
{
private static BuildAssetWindow window;
-
[MenuItem("Evo/资源打包工具")]
static void ShowWindows()
@@ -169,6 +169,7 @@ namespace Stary.Evo.Editor
#endregion
#region Update
+
[Title("BuildAssetButton", titleAlignment: TitleAlignments.Centered)] [HideLabel]
public BuildAssetEntity onBuildPipelineEntity;
@@ -184,7 +185,7 @@ namespace Stary.Evo.Editor
private bool _isCheckDriveExist;
-
+
[TitleGroup("UpdateAssetButton", alignment: TitleAlignments.Centered)]
[HideLabel]
[ShowIf(
@@ -209,9 +210,35 @@ namespace Stary.Evo.Editor
{
if (EditorUtility.DisplayDialog("提示", $"开始上传至服务器[{selectedPackageNames}]!", "Yes", "No"))
{
- Stary.Evo.Editor.FileUtility.CopyDirectory(
- $"{AssetBundleBuilderHelper.GetDefaultBuildOutputRoot()}/{EditorUserBuildSettings.activeBuildTarget}/{BuildAssetDataSetting.packageName}/{BuildAssetDataSetting.packageVersion}",
- updateServerPath);
+ // 新增:打包为zip的逻辑
+ string zipFileName =
+ $"{BuildAssetDataSetting.packageName}_{BuildAssetDataSetting.packageVersion}.zip";
+ var outputPackageDirectory =
+ $"{AssetBundleBuilderHelper.GetDefaultBuildOutputRoot()}/{EditorUserBuildSettings.activeBuildTarget}/{BuildAssetDataSetting.packageName}";
+ //拷贝目录
+ string outFilePath = $"{outputPackageDirectory}/{BuildAssetDataSetting.packageVersion}";
+ //输出目录
+ string zipFilePath = Path.Combine(outputPackageDirectory, zipFileName);
+ try
+ {
+ // 压缩输出目录到zip文件(会覆盖已存在的同名文件)
+ ZipFile.CreateFromDirectory(
+ outFilePath,
+ zipFilePath,
+ System.IO.Compression.CompressionLevel.Optimal,
+ false
+ );
+
+ Debug.Log($"成功打包为zip:{zipFilePath}");
+ }
+ catch (Exception ex)
+ {
+ Debug.LogError($"打包zip失败:{ex.Message}");
+ return;
+ }
+
+ Stary.Evo.Editor.FileUtility.Copy(
+ zipFilePath, $"{updateServerPath}/{zipFileName}", true);
CreatePackageVersionJson();
@@ -248,7 +275,7 @@ namespace Stary.Evo.Editor
base.DrawEditor(index);
}
GUILayout.EndScrollView();
-
+
BuildServerPath();
UpdateBuildPipelineButtonName();
}
@@ -258,6 +285,7 @@ namespace Stary.Evo.Editor
onBuildPipelineEntity.SetButtonName($"打包资源包【版本:{BuildAssetDataSetting.packageVersion}】");
onUpdateBuildPipelineEntity.SetButtonName($"更新至服务器【版本:{BuildAssetDataSetting.packageVersion}】");
}
+
///
/// 生成服务器路径
///
diff --git a/Assets/00.StaryEvo/Editor/BuildAsset/ScriptableBuildPipelineViewer.cs b/Assets/00.StaryEvo/Editor/BuildAsset/ScriptableBuildPipelineViewer.cs
index d008e90..e3a14b3 100644
--- a/Assets/00.StaryEvo/Editor/BuildAsset/ScriptableBuildPipelineViewer.cs
+++ b/Assets/00.StaryEvo/Editor/BuildAsset/ScriptableBuildPipelineViewer.cs
@@ -43,6 +43,7 @@ namespace Stary.Evo.Editor
buildParameters.BuiltinShadersBundleName = builtinShaderBundleName;
buildParameters.EncryptionServices = CreateEncryptionInstance();
+
ScriptableBuildPipeline pipeline = new ScriptableBuildPipeline();
var buildResult = pipeline.Run(buildParameters, true);
if (buildResult.Success)
@@ -51,6 +52,7 @@ namespace Stary.Evo.Editor
// EditorUtility.RevealInFinder(buildResult.OutputPackageDirectory);
base.ExecuteBuild();
}
+
}
///
diff --git a/Assets/00.StaryEvo/Runtime/Utility/WebRequestSystem.cs b/Assets/00.StaryEvo/Runtime/Utility/WebRequestSystem.cs
index e7a4a3c..f99468a 100644
--- a/Assets/00.StaryEvo/Runtime/Utility/WebRequestSystem.cs
+++ b/Assets/00.StaryEvo/Runtime/Utility/WebRequestSystem.cs
@@ -87,5 +87,8 @@ namespace Stary.Evo
}
+
+
+
}
}
\ No newline at end of file
diff --git a/Assets/Main/Config.meta b/Assets/Main/Config.meta
new file mode 100644
index 0000000..bc261eb
--- /dev/null
+++ b/Assets/Main/Config.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: cffabde4e6a86aa4abfd2686fcbfb3b3
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Config/DomainConfig.asset b/Assets/Main/Config/DomainConfig.asset
new file mode 100644
index 0000000..7d5a0ff
--- /dev/null
+++ b/Assets/Main/Config/DomainConfig.asset
@@ -0,0 +1,18 @@
+%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: 03dc1bf5b95446838cce6d0fefed81fe, type: 3}
+ m_Name: DomainConfig
+ m_EditorClassIdentifier:
+ domain:
+ mainPrefab: Prefabs_UI
+ className: Hello
+ methodName: Run
diff --git a/Assets/Main/Config/DomainConfig.asset.meta b/Assets/Main/Config/DomainConfig.asset.meta
new file mode 100644
index 0000000..93725f5
--- /dev/null
+++ b/Assets/Main/Config/DomainConfig.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d3b6d9514b4a312439b12cc9c5f52969
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Editor.meta b/Assets/Main/Editor.meta
new file mode 100644
index 0000000..905ad5f
--- /dev/null
+++ b/Assets/Main/Editor.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 92096ae44651c5d469092abe04c14498
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Editor/BuildCommand.cs b/Assets/Main/Editor/BuildCommand.cs
new file mode 100644
index 0000000..e693598
--- /dev/null
+++ b/Assets/Main/Editor/BuildCommand.cs
@@ -0,0 +1,288 @@
+using UnityEditor;
+using System.Linq;
+using System;
+using System.IO;
+
+static class BuildCommand
+{
+ private const string KEYSTORE_PASS = "KEYSTORE_PASS";
+ private const string KEY_ALIAS_PASS = "KEY_ALIAS_PASS";
+ private const string KEY_ALIAS_NAME = "KEY_ALIAS_NAME";
+ private const string KEYSTORE = "keystore.keystore";
+ private const string BUILD_OPTIONS_ENV_VAR = "BuildOptions";
+ private const string ANDROID_BUNDLE_VERSION_CODE = "VERSION_BUILD_VAR";
+ private const string ANDROID_APP_BUNDLE = "BUILD_APP_BUNDLE";
+ private const string SCRIPTING_BACKEND_ENV_VAR = "SCRIPTING_BACKEND";
+ private const string VERSION_NUMBER_VAR = "VERSION_NUMBER_VAR";
+ private const string VERSION_iOS = "VERSION_BUILD_VAR";
+
+ static string GetArgument(string name)
+ {
+ string[] args = Environment.GetCommandLineArgs();
+ for (int i = 0; i < args.Length; i++)
+ {
+ if (args[i].Contains(name))
+ {
+ return args[i + 1];
+ }
+ }
+ return null;
+ }
+
+ static string[] GetEnabledScenes()
+ {
+ return (
+ from scene in EditorBuildSettings.scenes
+ where scene.enabled
+ where !string.IsNullOrEmpty(scene.path)
+ select scene.path
+ ).ToArray();
+ }
+
+ static BuildTarget GetBuildTarget()
+ {
+ string buildTargetName = GetArgument("customBuildTarget");
+ Console.WriteLine(":: Received customBuildTarget " + buildTargetName);
+
+ if (buildTargetName.ToLower() == "android")
+ {
+#if !UNITY_5_6_OR_NEWER
+ // https://issuetracker.unity3d.com/issues/buildoptions-dot-acceptexternalmodificationstoplayer-causes-unityexception-unknown-project-type-0
+ // Fixed in Unity 5.6.0
+ // side effect to fix android build system:
+ EditorUserBuildSettings.androidBuildSystem = AndroidBuildSystem.Internal;
+#endif
+ }
+
+ if (buildTargetName.TryConvertToEnum(out BuildTarget target))
+ return target;
+
+ Console.WriteLine($":: {nameof(buildTargetName)} \"{buildTargetName}\" not defined on enum {nameof(BuildTarget)}, using {nameof(BuildTarget.NoTarget)} enum to build");
+
+ return BuildTarget.NoTarget;
+ }
+
+ static string GetBuildPath()
+ {
+ string buildPath = GetArgument("customBuildPath");
+ Console.WriteLine(":: Received customBuildPath " + buildPath);
+ if (buildPath == "")
+ {
+ throw new Exception("customBuildPath argument is missing");
+ }
+ return buildPath;
+ }
+
+ static string GetBuildName()
+ {
+ string buildName = GetArgument("customBuildName");
+ Console.WriteLine(":: Received customBuildName " + buildName);
+ if (buildName == "")
+ {
+ throw new Exception("customBuildName argument is missing");
+ }
+ return buildName;
+ }
+
+ static string GetFixedBuildPath(BuildTarget buildTarget, string buildPath, string buildName)
+ {
+ if (buildTarget.ToString().ToLower().Contains("windows")) {
+ buildName += ".exe";
+ } else if (buildTarget == BuildTarget.Android) {
+#if UNITY_2018_3_OR_NEWER
+ buildName += EditorUserBuildSettings.buildAppBundle ? ".aab" : ".apk";
+#else
+ buildName += ".apk";
+#endif
+ }
+ return buildPath + buildName;
+ }
+
+ static BuildOptions GetBuildOptions()
+ {
+ if (TryGetEnv(BUILD_OPTIONS_ENV_VAR, out string envVar)) {
+ string[] allOptionVars = envVar.Split(',');
+ BuildOptions allOptions = BuildOptions.None;
+ BuildOptions option;
+ string optionVar;
+ int length = allOptionVars.Length;
+
+ Console.WriteLine($":: Detecting {BUILD_OPTIONS_ENV_VAR} env var with {length} elements ({envVar})");
+
+ for (int i = 0; i < length; i++) {
+ optionVar = allOptionVars[i];
+
+ if (optionVar.TryConvertToEnum(out option)) {
+ allOptions |= option;
+ }
+ else {
+ Console.WriteLine($":: Cannot convert {optionVar} to {nameof(BuildOptions)} enum, skipping it.");
+ }
+ }
+
+ return allOptions;
+ }
+
+ return BuildOptions.None;
+ }
+
+ // https://stackoverflow.com/questions/1082532/how-to-tryparse-for-enum-value
+ static bool TryConvertToEnum(this string strEnumValue, out TEnum value)
+ {
+ if (!Enum.IsDefined(typeof(TEnum), strEnumValue))
+ {
+ value = default;
+ return false;
+ }
+
+ value = (TEnum)Enum.Parse(typeof(TEnum), strEnumValue);
+ return true;
+ }
+
+ static bool TryGetEnv(string key, out string value)
+ {
+ value = Environment.GetEnvironmentVariable(key);
+ return !string.IsNullOrEmpty(value);
+ }
+
+ static void SetScriptingBackendFromEnv(BuildTarget platform) {
+ var targetGroup = BuildPipeline.GetBuildTargetGroup(platform);
+ if (TryGetEnv(SCRIPTING_BACKEND_ENV_VAR, out string scriptingBackend)) {
+ if (scriptingBackend.TryConvertToEnum(out ScriptingImplementation backend)) {
+ Console.WriteLine($":: Setting ScriptingBackend to {backend}");
+ PlayerSettings.SetScriptingBackend(targetGroup, backend);
+ } else {
+ string possibleValues = string.Join(", ", Enum.GetValues(typeof(ScriptingImplementation)).Cast());
+ throw new Exception($"Could not find '{scriptingBackend}' in ScriptingImplementation enum. Possible values are: {possibleValues}");
+ }
+ } else {
+ var defaultBackend = PlayerSettings.GetDefaultScriptingBackend(targetGroup);
+ Console.WriteLine($":: Using project's configured ScriptingBackend (should be {defaultBackend} for targetGroup {targetGroup}");
+ }
+ }
+
+ static void PerformBuild()
+ {
+ var buildTarget = GetBuildTarget();
+
+ Console.WriteLine(":: Performing build");
+ if (TryGetEnv(VERSION_NUMBER_VAR, out var bundleVersionNumber))
+ {
+ if (buildTarget == BuildTarget.iOS)
+ {
+ bundleVersionNumber = GetIosVersion();
+ }
+ Console.WriteLine($":: Setting bundleVersionNumber to '{bundleVersionNumber}' (Length: {bundleVersionNumber.Length})");
+ PlayerSettings.bundleVersion = bundleVersionNumber;
+ }
+
+ if (buildTarget == BuildTarget.Android) {
+ HandleAndroidAppBundle();
+ HandleAndroidBundleVersionCode();
+ HandleAndroidKeystore();
+ }
+
+ var buildPath = GetBuildPath();
+ var buildName = GetBuildName();
+ var buildOptions = GetBuildOptions();
+ var fixedBuildPath = GetFixedBuildPath(buildTarget, buildPath, buildName);
+
+ SetScriptingBackendFromEnv(buildTarget);
+
+ var buildReport = BuildPipeline.BuildPlayer(GetEnabledScenes(), fixedBuildPath, buildTarget, buildOptions);
+
+ if (buildReport.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded)
+ throw new Exception($"Build ended with {buildReport.summary.result} status");
+
+ Console.WriteLine(":: Done with build");
+ }
+
+ private static void HandleAndroidAppBundle()
+ {
+ if (TryGetEnv(ANDROID_APP_BUNDLE, out string value))
+ {
+#if UNITY_2018_3_OR_NEWER
+ if (bool.TryParse(value, out bool buildAppBundle))
+ {
+ EditorUserBuildSettings.buildAppBundle = buildAppBundle;
+ Console.WriteLine($":: {ANDROID_APP_BUNDLE} env var detected, set buildAppBundle to {value}.");
+ }
+ else
+ {
+ Console.WriteLine($":: {ANDROID_APP_BUNDLE} env var detected but the value \"{value}\" is not a boolean.");
+ }
+#else
+ Console.WriteLine($":: {ANDROID_APP_BUNDLE} env var detected but does not work with lower Unity version than 2018.3");
+#endif
+ }
+ }
+
+ private static void HandleAndroidBundleVersionCode()
+ {
+ if (TryGetEnv(ANDROID_BUNDLE_VERSION_CODE, out string value))
+ {
+ if (int.TryParse(value, out int version))
+ {
+ PlayerSettings.Android.bundleVersionCode = version;
+ Console.WriteLine($":: {ANDROID_BUNDLE_VERSION_CODE} env var detected, set the bundle version code to {value}.");
+ }
+ else
+ Console.WriteLine($":: {ANDROID_BUNDLE_VERSION_CODE} env var detected but the version value \"{value}\" is not an integer.");
+ }
+ }
+
+ private static string GetIosVersion()
+ {
+ if (TryGetEnv(VERSION_iOS, out string value))
+ {
+ if (int.TryParse(value, out int version))
+ {
+ Console.WriteLine($":: {VERSION_iOS} env var detected, set the version to {value}.");
+ return version.ToString();
+ }
+ else
+ Console.WriteLine($":: {VERSION_iOS} env var detected but the version value \"{value}\" is not an integer.");
+ }
+
+ throw new ArgumentNullException(nameof(value), $":: Error finding {VERSION_iOS} env var");
+ }
+
+ private static void HandleAndroidKeystore()
+ {
+#if UNITY_2019_1_OR_NEWER
+ PlayerSettings.Android.useCustomKeystore = false;
+#endif
+
+ if (!File.Exists(KEYSTORE)) {
+ Console.WriteLine($":: {KEYSTORE} not found, skipping setup, using Unity's default keystore");
+ return;
+ }
+
+ PlayerSettings.Android.keystoreName = KEYSTORE;
+
+ string keystorePass;
+ string keystoreAliasPass;
+
+ if (TryGetEnv(KEY_ALIAS_NAME, out string keyaliasName)) {
+ PlayerSettings.Android.keyaliasName = keyaliasName;
+ Console.WriteLine($":: using ${KEY_ALIAS_NAME} env var on PlayerSettings");
+ } else {
+ Console.WriteLine($":: ${KEY_ALIAS_NAME} env var not set, using Project's PlayerSettings");
+ }
+
+ if (!TryGetEnv(KEYSTORE_PASS, out keystorePass)) {
+ Console.WriteLine($":: ${KEYSTORE_PASS} env var not set, skipping setup, using Unity's default keystore");
+ return;
+ }
+
+ if (!TryGetEnv(KEY_ALIAS_PASS, out keystoreAliasPass)) {
+ Console.WriteLine($":: ${KEY_ALIAS_PASS} env var not set, skipping setup, using Unity's default keystore");
+ return;
+ }
+#if UNITY_2019_1_OR_NEWER
+ PlayerSettings.Android.useCustomKeystore = true;
+#endif
+ PlayerSettings.Android.keystorePass = keystorePass;
+ PlayerSettings.Android.keyaliasPass = keystoreAliasPass;
+ }
+}
diff --git a/Assets/Main/Editor/BuildCommand.cs.meta b/Assets/Main/Editor/BuildCommand.cs.meta
new file mode 100644
index 0000000..4f989c6
--- /dev/null
+++ b/Assets/Main/Editor/BuildCommand.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 7c1e435333ed4df8b2e136d0be8c6843
+timeCreated: 1743490492
\ No newline at end of file
diff --git a/Assets/Main/Editor/BuildPostProcess.cs b/Assets/Main/Editor/BuildPostProcess.cs
new file mode 100644
index 0000000..4b2446c
--- /dev/null
+++ b/Assets/Main/Editor/BuildPostProcess.cs
@@ -0,0 +1,71 @@
+using UnityEditor.Callbacks;
+using UnityEditor;
+using System.IO;
+using UnityEngine;
+
+#if UNITY_IOS
+using UnityEditor.iOS.Xcode;
+
+public static class BuildPostProcess
+{
+ private const string PLIST_FILE = "Info.plist";
+ private const string EXIST_ON_SUSPEND_KEY = "UIApplicationExitsOnSuspend";
+
+ private const string VERSIONING_SYSTEM_KEY = "VERSIONING_SYSTEM";
+ private const string CURRENT_PROJECT_VERSION_KEY = "CURRENT_PROJECT_VERSION";
+ private const string APPLE_GENERIC_VALUE = "apple-generic";
+
+ private const string ENABLE_BITCODE_KEY = "ENABLE_BITCODE";
+
+ private const string CODE_SIGN_STYLE_KEY = "CODE_SIGN_STYLE";
+ private const string PROVISIONING_PROFILE_SPECIFIER_KEY = "PROVISIONING_PROFILE_SPECIFIER";
+ private const string PROVISIONING_PROFILE_KEY = "PROVISIONING_PROFILE";
+
+
+ [PostProcessBuild(1)]
+ public static void IOSBuildPostProcess(BuildTarget target, string pathToBuiltProject)
+ {
+ RemoveDeprecatedInfoPListKeys(pathToBuiltProject);
+
+ string projectPath = PBXProject.GetPBXProjectPath(pathToBuiltProject);
+ var pbxProject = new PBXProject();
+ pbxProject.ReadFromFile(projectPath);
+
+#if UNITY_2020_1_OR_NEWER
+ var guidProject = pbxProject.GetUnityMainTargetGuid();
+#else
+ var guidProject = pbxProject.TargetGuidByName(pbxProject.GetUnityMainTargetGuid());
+#endif
+
+ Debug.Log("Setting Versioning system to Apple Generic...");
+ pbxProject.SetBuildProperty(guidProject, VERSIONING_SYSTEM_KEY, APPLE_GENERIC_VALUE);
+ pbxProject.SetBuildProperty(guidProject, CURRENT_PROJECT_VERSION_KEY, "1");
+
+ Debug.Log("Disabling bitcode...");
+ pbxProject.SetBuildProperty(guidProject, ENABLE_BITCODE_KEY, "NO");
+
+ Debug.Log("Setting Code sign style to manual and setup provisioning profile specifier...");
+ pbxProject.SetBuildProperty(guidProject, CODE_SIGN_STYLE_KEY, "Manual");
+ pbxProject.SetBuildProperty(guidProject, PROVISIONING_PROFILE_SPECIFIER_KEY, pbxProject.GetBuildPropertyForAnyConfig(guidProject, PROVISIONING_PROFILE_KEY));
+
+ pbxProject.WriteToFile(projectPath);
+ }
+
+ private static void RemoveDeprecatedInfoPListKeys(string pathToBuiltProject)
+ {
+ string plistPath = Path.Combine(pathToBuiltProject, PLIST_FILE);
+ PlistDocument plist = new PlistDocument();
+ plist.ReadFromString(File.ReadAllText(plistPath));
+
+ PlistElementDict rootDict = plist.root;
+
+ if (rootDict.values.ContainsKey(EXIST_ON_SUSPEND_KEY))
+ {
+ Debug.LogFormat("Removing deprecated key \"{0}\" on \"{1}\" file", EXIST_ON_SUSPEND_KEY, PLIST_FILE);
+ rootDict.values.Remove(EXIST_ON_SUSPEND_KEY);
+ }
+
+ File.WriteAllText(plistPath, plist.WriteToString());
+ }
+}
+#endif
diff --git a/Assets/Main/Editor/BuildPostProcess.cs.meta b/Assets/Main/Editor/BuildPostProcess.cs.meta
new file mode 100644
index 0000000..5295b29
--- /dev/null
+++ b/Assets/Main/Editor/BuildPostProcess.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: e84dd163f51449218c7e6680b682e7e3
+timeCreated: 1743490492
\ No newline at end of file
diff --git a/Assets/Main/Editor/YooAsset.meta b/Assets/Main/Editor/YooAsset.meta
new file mode 100644
index 0000000..f5f24ad
--- /dev/null
+++ b/Assets/Main/Editor/YooAsset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0dfec6660d6d5d34c9a5b4ba8a2e3498
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Editor/YooAsset/PackageComparatorWindow.cs b/Assets/Main/Editor/YooAsset/PackageComparatorWindow.cs
new file mode 100644
index 0000000..7d4d283
--- /dev/null
+++ b/Assets/Main/Editor/YooAsset/PackageComparatorWindow.cs
@@ -0,0 +1,163 @@
+using System.IO;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEditor;
+
+namespace YooAsset.Editor
+{
+ public class PackageComparatorWindow : EditorWindow
+ {
+ static PackageComparatorWindow _thisInstance;
+
+ [MenuItem("Evo/YooAsset/补丁包比对工具", false, 102)]
+ static void ShowWindow()
+ {
+ if (_thisInstance == null)
+ {
+ _thisInstance = EditorWindow.GetWindow(typeof(PackageComparatorWindow), false, "补丁包比对工具", true) as PackageComparatorWindow;
+ _thisInstance.minSize = new Vector2(800, 600);
+ }
+ _thisInstance.Show();
+ }
+
+ private string _manifestPath1 = string.Empty;
+ private string _manifestPath2 = string.Empty;
+ private readonly List _changeList = new List();
+ private readonly List _newList = new List();
+ private readonly List _deleteList = new List();
+ private Vector2 _scrollPos1;
+ private Vector2 _scrollPos2;
+ private Vector2 _scrollPos3;
+ private void OnGUI()
+ {
+ GUILayout.Space(10);
+ EditorGUILayout.BeginHorizontal();
+ if (GUILayout.Button("选择补丁包1", GUILayout.MaxWidth(150)))
+ {
+ string resultPath = EditorUtility.OpenFilePanel("Find", "Assets/", "bytes");
+ if (string.IsNullOrEmpty(resultPath))
+ return;
+ _manifestPath1 = resultPath;
+ }
+ EditorGUILayout.LabelField(_manifestPath1);
+ EditorGUILayout.EndHorizontal();
+
+ GUILayout.Space(10);
+ EditorGUILayout.BeginHorizontal();
+ if (GUILayout.Button("选择补丁包2", GUILayout.MaxWidth(150)))
+ {
+ string resultPath = EditorUtility.OpenFilePanel("Find", "Assets/", "bytes");
+ if (string.IsNullOrEmpty(resultPath))
+ return;
+ _manifestPath2 = resultPath;
+ }
+ EditorGUILayout.LabelField(_manifestPath2);
+ EditorGUILayout.EndHorizontal();
+
+ if (string.IsNullOrEmpty(_manifestPath1) == false && string.IsNullOrEmpty(_manifestPath2) == false)
+ {
+ if (GUILayout.Button("比对差异", GUILayout.MaxWidth(150)))
+ {
+ ComparePackage(_changeList, _newList);
+ }
+ }
+
+ EditorGUILayout.Space();
+ using (new EditorGUI.DisabledScope(false))
+ {
+ int totalCount = _changeList.Count;
+ EditorGUILayout.Foldout(true, $"差异列表 ( {totalCount} )");
+
+ EditorGUI.indentLevel = 1;
+ _scrollPos1 = EditorGUILayout.BeginScrollView(_scrollPos1);
+ {
+ foreach (var bundle in _changeList)
+ {
+ EditorGUILayout.LabelField($"{bundle.BundleName} | {(bundle.FileSize / 1024)}K");
+ }
+ }
+ EditorGUILayout.EndScrollView();
+ EditorGUI.indentLevel = 0;
+ }
+
+ EditorGUILayout.Space();
+ using (new EditorGUI.DisabledScope(false))
+ {
+ int totalCount = _newList.Count;
+ EditorGUILayout.Foldout(true, $"新增列表 ( {totalCount} )");
+
+ EditorGUI.indentLevel = 1;
+ _scrollPos2 = EditorGUILayout.BeginScrollView(_scrollPos2);
+ {
+ foreach (var bundle in _newList)
+ {
+ EditorGUILayout.LabelField($"{bundle.BundleName}");
+ }
+ }
+ EditorGUILayout.EndScrollView();
+ EditorGUI.indentLevel = 0;
+ }
+ EditorGUILayout.Space();
+ using (new EditorGUI.DisabledScope(false))
+ {
+ int totalCount = _deleteList.Count;
+ EditorGUILayout.Foldout(true, $"删除列表 ( {totalCount} )");
+
+ EditorGUI.indentLevel = 1;
+ _scrollPos3 = EditorGUILayout.BeginScrollView(_scrollPos3);
+ {
+ foreach (var bundle in _deleteList)
+ {
+ EditorGUILayout.LabelField($"{bundle.BundleName}");
+ }
+ }
+ EditorGUILayout.EndScrollView();
+ EditorGUI.indentLevel = 0;
+ }
+ }
+
+ private void ComparePackage(List changeList, List newList)
+ {
+ changeList.Clear();
+ newList.Clear();
+
+ // 加载补丁清单1
+ byte[] bytesData1 = FileUtility.ReadAllBytes(_manifestPath1);
+ PackageManifest manifest1 = ManifestTools.DeserializeFromBinary(bytesData1);
+
+ // 加载补丁清单1
+ byte[] bytesData2 = FileUtility.ReadAllBytes(_manifestPath2);
+ PackageManifest manifest2 = ManifestTools.DeserializeFromBinary(bytesData2);
+
+ // 拷贝文件列表
+ foreach (var bundle2 in manifest2.BundleList)
+ {
+ if (manifest1.TryGetPackageBundleByBundleName(bundle2.BundleName, out PackageBundle bundle1))
+ {
+ if (bundle2.FileHash != bundle1.FileHash)
+ {
+ changeList.Add(bundle2);
+ }
+ else
+ {
+
+ //检测是否新增
+
+ }
+
+ }
+ else
+ {
+ newList.Add(bundle2);
+ }
+ }
+
+ // 按字母重新排序
+ changeList.Sort((x, y) => string.Compare(x.BundleName, y.BundleName));
+ newList.Sort((x, y) => string.Compare(x.BundleName, y.BundleName));
+
+ Debug.Log("资源包差异比对完成!");
+ }
+ }
+}
diff --git a/Assets/Main/Editor/YooAsset/PackageComparatorWindow.cs.meta b/Assets/Main/Editor/YooAsset/PackageComparatorWindow.cs.meta
new file mode 100644
index 0000000..efc87bd
--- /dev/null
+++ b/Assets/Main/Editor/YooAsset/PackageComparatorWindow.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6ff3c700b7f108b48998aa1630a769e1
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Resources.meta b/Assets/Main/Resources.meta
new file mode 100644
index 0000000..d0eb665
--- /dev/null
+++ b/Assets/Main/Resources.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 9b1f406d4fee216498272467f8d5ea4d
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Resources/ArchitectureTemplate.txt b/Assets/Main/Resources/ArchitectureTemplate.txt
new file mode 100644
index 0000000..b62544d
--- /dev/null
+++ b/Assets/Main/Resources/ArchitectureTemplate.txt
@@ -0,0 +1,12 @@
+
+namespace NamespaceX
+{
+ public class ArchitectureX : Architecture
+ {
+ protected override void Init()
+ {
+ //注册示例
+ //RegisterSystem(new ScoreSystem());
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Resources/ArchitectureTemplate.txt.meta b/Assets/Main/Resources/ArchitectureTemplate.txt.meta
new file mode 100644
index 0000000..6b6d4dc
--- /dev/null
+++ b/Assets/Main/Resources/ArchitectureTemplate.txt.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 87dbc7ed6b6d56d4192c57f52677788e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Resources/AssemblyDefinitionTemplate.txt b/Assets/Main/Resources/AssemblyDefinitionTemplate.txt
new file mode 100644
index 0000000..433b9c2
--- /dev/null
+++ b/Assets/Main/Resources/AssemblyDefinitionTemplate.txt
@@ -0,0 +1,18 @@
+{
+ "name": "MODULE_IDENT",
+ "rootNamespace": "ROOT_NAMESPACE",
+ "references": [
+ "GUID:d1a793c2b6959e04ea45b972eaa369c8",
+ "GUID:e34a5702dd353724aa315fb8011f08c3",
+ "GUID:4492e37c9663479418f9522cc4796b57"
+ ],
+ "includePlatforms": [],
+ "excludePlatforms": [],
+ "allowUnsafeCode": true,
+ "overrideReferences": false,
+ "precompiledReferences": [],
+ "autoReferenced": false,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": false
+}
\ No newline at end of file
diff --git a/Assets/Main/Resources/AssemblyDefinitionTemplate.txt.meta b/Assets/Main/Resources/AssemblyDefinitionTemplate.txt.meta
new file mode 100644
index 0000000..436b73e
--- /dev/null
+++ b/Assets/Main/Resources/AssemblyDefinitionTemplate.txt.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 0f96d3c3c5e9b98439185f95d7135c9b
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Resources/BuildAssetDataSetting.asset b/Assets/Main/Resources/BuildAssetDataSetting.asset
new file mode 100644
index 0000000..ad6a592
--- /dev/null
+++ b/Assets/Main/Resources/BuildAssetDataSetting.asset
@@ -0,0 +1,36 @@
+%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: 39a67460f559484da2b52def8ff05571, type: 3}
+ m_Name: BuildAssetDataSetting
+ m_EditorClassIdentifier:
+ serializationData:
+ SerializedFormat: 2
+ SerializedBytes:
+ ReferencedUnityObjects: []
+ SerializedBytesString:
+ Prefab: {fileID: 0}
+ PrefabModificationsReferencedUnityObjects: []
+ PrefabModifications: []
+ SerializationNodes: []
+ packageName: J0001
+ packageVersionX: 1
+ packageVersionY: 0
+ packageVersionZ: 0
+ environmentType: 1
+ selectedBuildPipelines: 1
+ packageVersion: 1.0.0
+ VersionType: 0
+ viewer:
+ clearBuildCacheToggle: 0
+ useAssetDependencyDBToggle: 1
+ copyBuildinFileOption: 1
+ copyBuildinFileParams:
diff --git a/Assets/Main/Resources/BuildAssetDataSetting.asset.meta b/Assets/Main/Resources/BuildAssetDataSetting.asset.meta
new file mode 100644
index 0000000..4a1ec6b
--- /dev/null
+++ b/Assets/Main/Resources/BuildAssetDataSetting.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0c92d0b29ec1042db972ce28367bb147
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Resources/DomainTemplate.txt b/Assets/Main/Resources/DomainTemplate.txt
new file mode 100644
index 0000000..a25dd27
--- /dev/null
+++ b/Assets/Main/Resources/DomainTemplate.txt
@@ -0,0 +1,48 @@
+using System.Threading.Tasks;
+using Stary.Evo;
+using UnityEngine;
+namespace NamespaceX
+{
+ public class ClassNameXX :DomainBase,IController
+ {
+ public override void OnEnter(string param)
+ {
+ base.OnEnter(param);
+ Debug.Log("UnityEvo: OnEnter进入成功");
+ }
+
+ public override void OnExit()
+ {
+ base.OnExit();
+ GetArchitecture().Dispose();
+ Debug.Log("UnityEvo: OnExit退出成功");
+ }
+
+ public override Task OnEnterAsync(string param)
+ {
+ Debug.Log("UnityEvo: OnEnterAsync进入成功");
+ return base.OnEnterAsync(param);
+ }
+
+ public override Task OnExitAsync()
+ {
+ Debug.Log("UnityEvo: OnEnterAsync退出成功");
+ return base.OnExitAsync();
+ }
+
+ public IArchitecture GetArchitecture()
+ {
+ return ReturnArchitecture.Interface;
+ }
+ }
+
+
+ public class ArchitectureX : Architecture
+ {
+ protected override void Init()
+ {
+ //注册示例
+ //RegisterSystem(new ScoreSystem());
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Resources/DomainTemplate.txt.meta b/Assets/Main/Resources/DomainTemplate.txt.meta
new file mode 100644
index 0000000..032cf0a
--- /dev/null
+++ b/Assets/Main/Resources/DomainTemplate.txt.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 021eede2852e4f19adfcb519fa2b7fbb
+timeCreated: 1742540660
\ No newline at end of file
diff --git a/Assets/Main/Resources/HotfixMainResDomain.asset b/Assets/Main/Resources/HotfixMainResDomain.asset
new file mode 100644
index 0000000..65eae46
--- /dev/null
+++ b/Assets/Main/Resources/HotfixMainResDomain.asset
@@ -0,0 +1,21 @@
+%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:
+ domain: MainDomain
+ ipconfig: http://192.168.31.100:5005/HotRefresh
+ pathconfig:
+ packageVersion:
+ username: UnityHot
+ password: Unity1234
diff --git a/Assets/Main/Resources/HotfixMainResDomain.asset.meta b/Assets/Main/Resources/HotfixMainResDomain.asset.meta
new file mode 100644
index 0000000..1008477
--- /dev/null
+++ b/Assets/Main/Resources/HotfixMainResDomain.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: baae28693819e9642b1bb2f800ecce11
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Resources/MainDomainAll.asset b/Assets/Main/Resources/MainDomainAll.asset
new file mode 100644
index 0000000..873554e
--- /dev/null
+++ b/Assets/Main/Resources/MainDomainAll.asset
@@ -0,0 +1,43 @@
+%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: 2745f06c743a4d8aaf3d993312e39f02, type: 3}
+ m_Name: MainDomainAll
+ m_EditorClassIdentifier:
+ domainAll:
+ - isVideo: 1
+ domainName: X_02_01
+ - isVideo: 1
+ domainName: X_02_02
+ - isVideo: 1
+ domainName: X_03_01_01
+ - isVideo: 1
+ domainName: X_03_01_02
+ - isVideo: 1
+ domainName: X_03_02_01
+ - isVideo: 1
+ domainName: X_03_02_02
+ - isVideo: 1
+ domainName: X_03_02_03
+ - isVideo: 1
+ domainName: X_04_01
+ - isVideo: 1
+ domainName: X_04_02
+ - isVideo: 1
+ domainName: X_04_03
+ - isVideo: 1
+ domainName: X_04_04
+ - isVideo: 1
+ domainName: X_04_05
+ - isVideo: 1
+ domainName: X_05_01
+ - isVideo: 1
+ domainName: X_06_01
diff --git a/Assets/Main/Resources/MainDomainAll.asset.meta b/Assets/Main/Resources/MainDomainAll.asset.meta
new file mode 100644
index 0000000..3ce0c59
--- /dev/null
+++ b/Assets/Main/Resources/MainDomainAll.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 8fce04c662e892f44a5237be36b53f2c
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Resources/PointGatherData.asset b/Assets/Main/Resources/PointGatherData.asset
new file mode 100644
index 0000000..c7e10d1
--- /dev/null
+++ b/Assets/Main/Resources/PointGatherData.asset
@@ -0,0 +1,140 @@
+%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: 79b808b96820ad546951a6859e2a99be, type: 3}
+ m_Name: PointGatherData
+ m_EditorClassIdentifier:
+ ZoneDatas:
+ - id: 2
+ name: X_02
+ desc: "\u751F\u547D\u5065\u5EB7\u533A"
+ spriteName: ui_zone1_shengmingjiankangqu
+ position: {x: -12.82, y: 0, z: 5.85}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ pointDatas:
+ - id: 1
+ name: X_02_01
+ position: {x: 0, y: 0, z: 0}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ desc: "\u5168\u751F\u547D\u5468\u671F"
+ - id: 2
+ name: X_02_02
+ position: {x: 0, y: 0, z: 0}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ desc: "\u4EBA\u4F53\u516B\u5927\u7CFB\u7EDF"
+ - id: 3
+ name: X_03
+ desc: "\u5065\u5EB7\u5F71\u54CD\u56E0\u7D20\u533A"
+ spriteName: ui_zone2_jiankangyingxiangyinsuqu
+ position: {x: -10.44, y: 0, z: 5.85}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ pointDatas:
+ - id: 1
+ name: X_03_01_01
+ position: {x: 0, y: 0, z: 0}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ desc: "\u5BA4\u5916\u5927\u73AF\u5883\u5F71\u54CD\u56E0\u7D20"
+ - id: 2
+ name: X_03_01_02
+ position: {x: 0, y: 0, z: 0}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ desc: "\u53A8\u623F\u73AF\u5883\u5F71\u54CD\u56E0\u7D20"
+ - id: 4
+ name: X_04
+ desc: "\u751F\u547D\u9632\u62A4\u533A"
+ spriteName: ui_zone3_shengmingfanghuqu
+ position: {x: -7.65, y: 0, z: 5.85}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ pointDatas:
+ - id: 3
+ name: X_03_02_01
+ position: {x: 0, y: 0, z: 0}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ desc: "\u542C\u529B\u5065\u5EB7"
+ - id: 4
+ name: X_03_02_02
+ position: {x: 0, y: 0, z: 0}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ desc: "\u89C6\u529B\u5065\u5EB7"
+ - id: 5
+ name: X_03_02_03
+ position: {x: 0, y: 0, z: 0}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ desc: "\u53E3\u8154\u5065\u5EB7"
+ - id: 4
+ name: X_05
+ desc: "\u5065\u5EB7\u7D20\u517B\u533A"
+ spriteName: ui_zone4_jiankangsuyangqu
+ position: {x: -4.54, y: 0, z: 5.85}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ pointDatas:
+ - id: 1
+ name: X_04_01
+ position: {x: 0, y: 0, z: 0}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ desc: "\u80A5\u80D6\u5371\u9669\u56E0\u7D20\uFF08\u6162\u75C5\uFF09"
+ - id: 2
+ name: X_04_02
+ position: {x: 0, y: 0, z: 0}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ desc: "\u4F20\u67D3\u75C5"
+ - id: 3
+ name: X_04_03
+ position: {x: 0, y: 0, z: 0}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ desc: "\u75C5\u5A92\u751F\u7269\u751F\u7269\u4F20\u67D3\u75C5"
+ - id: 4
+ name: X_04_04
+ position: {x: 0, y: 0, z: 0}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ desc: "\u72C2\u72AC\u75C5"
+ - id: 5
+ name: X_04_05
+ position: {x: 0, y: 0, z: 0}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ desc: "\u5FAE\u751F\u7269\u5927\u4F5C\u6218"
+ - id: 6
+ name: X_06
+ desc: "\u5065\u5EB7\u751F\u6D3B\u65B9\u5F0F\u533A"
+ spriteName: ui_zone5_jiankangshenghuofangshiqu
+ position: {x: -1.04, y: 0, z: 5.85}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ pointDatas:
+ - id: 1
+ name: X_05_01
+ position: {x: 0, y: 0, z: 0}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ desc: "\u60C5\u7EEA\u6025\u6551\u7BB1"
+ - id: 1
+ name: ' X_06_01'
+ position: {x: 0, y: 0, z: 0}
+ rotation: {x: -0, y: 0, z: 0}
+ scale: {x: 1, y: 1, z: 1}
+ desc: "\u996E\u9152\u5371\u5BB3"
+ targetGameObject: {fileID: 0}
diff --git a/Assets/Main/Resources/PointGatherData.asset.meta b/Assets/Main/Resources/PointGatherData.asset.meta
new file mode 100644
index 0000000..2b36d2a
--- /dev/null
+++ b/Assets/Main/Resources/PointGatherData.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 17ac95220ddc8a449804eb0969d6297b
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Script.meta b/Assets/Main/Script.meta
new file mode 100644
index 0000000..90efbde
--- /dev/null
+++ b/Assets/Main/Script.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: fbceddee670338442a9efee8c4a64fe2
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Script/Editor.meta b/Assets/Main/Script/Editor.meta
new file mode 100644
index 0000000..def8a5f
--- /dev/null
+++ b/Assets/Main/Script/Editor.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: f50e24669aba44ba98efe5c74695fed5
+timeCreated: 1744077396
\ No newline at end of file
diff --git a/Assets/Main/Script/Editor/DomainBaseEditor.cs b/Assets/Main/Script/Editor/DomainBaseEditor.cs
new file mode 100644
index 0000000..50975bc
--- /dev/null
+++ b/Assets/Main/Script/Editor/DomainBaseEditor.cs
@@ -0,0 +1,79 @@
+// using UnityEditor;
+// using UnityEngine;
+//
+// namespace Stary.Evo
+// {
+// [CustomEditor(typeof(DomainBase), true)]
+// public class DomainBaseEditor : UnityEditor.Editor
+// {
+// //定义序列化属性
+// // private SerializedProperty intValue;
+// // private SerializedProperty floatValue;
+// // private SerializedProperty stringValue;
+// // private SerializedProperty boolValue;
+// // private SerializedProperty vector3Value;
+// // private SerializedProperty enumValue;
+// // private SerializedProperty colorValue;
+// // private SerializedProperty textureValue;
+// ///
+// /// 序列化属性,在OnEnable中获取
+// ///
+// [HideInInspector]
+// private SerializedProperty domainConfig;
+// [HideInInspector]
+// private SerializedProperty domainName;
+//
+// private UnityEditor.Editor cacheEditor;
+// private void OnEnable()
+// {
+// domainConfig = serializedObject.FindProperty("domainConfig");
+// if (!Application.isPlaying)
+// {
+//
+// domainName = serializedObject.FindProperty("DomainName");
+// domainConfig.objectReferenceValue =
+// AssetDatabase.LoadAssetAtPath(
+// $"Assets/Domain/{domainName.stringValue}/AddressableRes/Config/DomainConfig.asset");
+// }
+// //通过名字查找被序列化属性。
+// // intValue = serializedObject.FindProperty("intValue");
+// // floatValue = serializedObject.FindProperty("floatValue");
+// // stringValue = serializedObject.FindProperty("stringValue");
+// // boolValue = serializedObject.FindProperty("boolValue");
+// // vector3Value = serializedObject.FindProperty("vector3Value");
+// // enumValue = serializedObject.FindProperty("enumValue");
+// // colorValue = serializedObject.FindProperty("colorValue");
+// // textureValue = serializedObject.FindProperty("textureValue");
+// }
+//
+// public override void OnInspectorGUI()
+// {
+// //表示更新序列化物体
+// serializedObject.Update();
+//
+// // EditorGUILayout.PropertyField(domainConfig,new GUIContent("111"),true);
+//
+//
+// var data = ((DomainConfig)domainConfig.objectReferenceValue);
+// if (data != null)
+// {
+// //创建TestClass的Editor
+// if (cacheEditor == null)
+// cacheEditor = UnityEditor. Editor.CreateEditor(data);
+// cacheEditor.OnInspectorGUI();
+// }
+//
+//
+// // EditorGUILayout.PropertyField(intValue);
+// // EditorGUILayout.PropertyField(floatValue);
+// // EditorGUILayout.PropertyField(stringValue);
+// // EditorGUILayout.PropertyField(boolValue);
+// // EditorGUILayout.PropertyField(vector3Value);
+// // EditorGUILayout.PropertyField(enumValue);
+// // EditorGUILayout.PropertyField(colorValue);
+// // EditorGUILayout.PropertyField(textureValue);
+// //应用修改的属性值,不加的话,Inspector面板的值修改不了
+// serializedObject.ApplyModifiedProperties();
+// }
+// }
+// }
\ No newline at end of file
diff --git a/Assets/Main/Script/Editor/DomainBaseEditor.cs.meta b/Assets/Main/Script/Editor/DomainBaseEditor.cs.meta
new file mode 100644
index 0000000..c17f21d
--- /dev/null
+++ b/Assets/Main/Script/Editor/DomainBaseEditor.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 4ca49f66bd64466d8cf1ede3acb36592
+timeCreated: 1744097384
\ No newline at end of file
diff --git a/Assets/Main/Script/Editor/HybridClREntranceEditor.cs b/Assets/Main/Script/Editor/HybridClREntranceEditor.cs
new file mode 100644
index 0000000..22b44a0
--- /dev/null
+++ b/Assets/Main/Script/Editor/HybridClREntranceEditor.cs
@@ -0,0 +1,51 @@
+using Stary.Evo.Editor;
+using UnityEditor;
+using UnityEngine;
+
+namespace Stary.Evo
+{
+ [CustomEditor(typeof(HybridClREntrance))]
+ public class HybridClREntranceEditor : UnityEditor.Editor
+ {
+ ///
+ /// 序列化属性,在OnEnable中获取
+ ///
+ [HideInInspector]
+ private SerializedProperty domain;
+
+ private string[] domainNames;
+ private void OnEnable()
+ {
+ domain = serializedObject.FindProperty("domain");
+ domainNames = CreatAssetWindow.GetCreatDomainAllName();
+
+ }
+
+ public override void OnInspectorGUI()
+ {
+ serializedObject.Update();
+
+ // 获取当前选中的索引
+ int selectedIndex = System.Array.IndexOf(domainNames, domain.stringValue);
+ if (selectedIndex < 0) selectedIndex = 0; // 默认选中第一个
+
+ // 绘制下拉选择框
+ selectedIndex = EditorGUILayout.Popup("Domain", selectedIndex, domainNames);
+
+ // 更新选择的域名
+ domain.stringValue = domainNames[selectedIndex];
+
+ serializedObject.ApplyModifiedProperties();
+
+ HybridClREntrance hybridClREntrance = target as HybridClREntrance;
+ if (GUILayout.Button("打开Domain"))
+ {
+ hybridClREntrance.OpenDomain();
+ }
+ if (GUILayout.Button("关闭Domain"))
+ {
+ hybridClREntrance.CloseDomain();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Editor/HybridClREntranceEditor.cs.meta b/Assets/Main/Script/Editor/HybridClREntranceEditor.cs.meta
new file mode 100644
index 0000000..4db11a8
--- /dev/null
+++ b/Assets/Main/Script/Editor/HybridClREntranceEditor.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: d0996e24f28249ccb2bfb2a14e1358c1
+timeCreated: 1744706140
\ No newline at end of file
diff --git a/Assets/Main/Script/Editor/PointGatherDataEditor.cs b/Assets/Main/Script/Editor/PointGatherDataEditor.cs
new file mode 100644
index 0000000..b46c090
--- /dev/null
+++ b/Assets/Main/Script/Editor/PointGatherDataEditor.cs
@@ -0,0 +1,66 @@
+using Stary.Evo.Editor;
+using UnityEditor;
+using UnityEngine;
+
+namespace Main
+{
+ [CustomEditor(typeof(PointGatherData))]
+ public class PointGatherDataEditor : UnityEditor.Editor
+ {
+
+
+
+ public override void OnInspectorGUI()
+ {
+ serializedObject.Update();
+ base.OnInspectorGUI();
+
+ PointGatherData pointGatherData = target as PointGatherData;
+ if (GUILayout.Button("一键生成坐标数据"))
+ {
+
+ ZoneController[] zoneControllers = FindObjectsOfType(true);
+ PointController[] pointControllers = FindObjectsOfType(true);
+ for (int i = 0; i < pointGatherData.ZoneDatas.Count; i++)
+ {
+ ZoneData zoneData = pointGatherData.ZoneDatas[i];
+
+ foreach (var zoneController in zoneControllers)
+ {
+ if (zoneController.name == zoneData.name)
+ {
+ zoneData.position = zoneController.transform.localPosition;
+ zoneData.rotation = zoneController.transform.localEulerAngles;
+ zoneData.scale = zoneController.transform.localScale;
+ }
+ }
+
+
+ for (int j = 0; j < zoneData.pointDatas.Count; j++)
+ {
+ PointData pointData = zoneData.pointDatas[j];
+
+
+
+ foreach (var pointController in pointControllers)
+ {
+ if (pointController.name == pointData.name)
+ {
+ pointData.position = pointController.transform.localPosition;
+ pointData.rotation = pointController.transform.localEulerAngles;
+ pointData.scale = pointController.transform.localScale;
+ }
+ }
+
+ }
+ }
+
+ EditorUtility.SetDirty(pointGatherData);
+ AssetDatabase.SaveAssets();
+ AssetDatabase.Refresh();
+
+
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Editor/PointGatherDataEditor.cs.meta b/Assets/Main/Script/Editor/PointGatherDataEditor.cs.meta
new file mode 100644
index 0000000..0f7b111
--- /dev/null
+++ b/Assets/Main/Script/Editor/PointGatherDataEditor.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 6eaaeb57d33f5704e8cd6b9527d78a6b
+timeCreated: 1744706140
\ No newline at end of file
diff --git a/Assets/Main/Script/Editor/stary.main.editor.asmdef b/Assets/Main/Script/Editor/stary.main.editor.asmdef
new file mode 100644
index 0000000..87fc410
--- /dev/null
+++ b/Assets/Main/Script/Editor/stary.main.editor.asmdef
@@ -0,0 +1,20 @@
+{
+ "name": "stary.main.editor",
+ "rootNamespace": "",
+ "references": [
+ "GUID:4492e37c9663479418f9522cc4796b57",
+ "GUID:d1a793c2b6959e04ea45b972eaa369c8",
+ "GUID:044184040b21c434b8aee6f2a3424c06"
+ ],
+ "includePlatforms": [
+ "Editor"
+ ],
+ "excludePlatforms": [],
+ "allowUnsafeCode": false,
+ "overrideReferences": false,
+ "precompiledReferences": [],
+ "autoReferenced": true,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": false
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Editor/stary.main.editor.asmdef.meta b/Assets/Main/Script/Editor/stary.main.editor.asmdef.meta
new file mode 100644
index 0000000..a78943d
--- /dev/null
+++ b/Assets/Main/Script/Editor/stary.main.editor.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 5c6af7aee383dac46b510d588d1b015d
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Script/Runtime.meta b/Assets/Main/Script/Runtime.meta
new file mode 100644
index 0000000..2f75eb2
--- /dev/null
+++ b/Assets/Main/Script/Runtime.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: ea087baad4524017b420384544bfae06
+timeCreated: 1744077212
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Base.meta b/Assets/Main/Script/Runtime/Base.meta
new file mode 100644
index 0000000..4aef910
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Base.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: a15f3bb70d00bcd4b8c01eb4ace17c3b
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Script/Runtime/Base/AppConfig.cs b/Assets/Main/Script/Runtime/Base/AppConfig.cs
new file mode 100644
index 0000000..fa2031e
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Base/AppConfig.cs
@@ -0,0 +1,52 @@
+using System;
+using UnityEngine;
+
+namespace Stary.Evo
+{
+ public class AppConfig
+ {
+ ///
+ /// package name
+ ///
+ public static string ASSETPACKGENAME;
+
+ ///
+ /// 热更资源路径
+ ///
+ public static string PATHCONFIG;
+
+ public static string IPCONFIG;
+ public static string USERNAME;
+ public static string PASSWORD;
+
+ public static string IPCONFIGVideo;
+
+ ///
+ /// 主场景main实例物体
+ ///
+ private static GameObject _MainBaseModel;
+
+ ///
+ /// 赋值默认的实例
+ ///
+ public static void SetDefaultMainInstance(GameObject mainbase)
+ {
+ _MainBaseModel = mainbase;
+ }
+
+ ///
+ /// 赋值默认的实例
+ ///
+ public static GameObject GetDefaultMainInstance()
+ {
+ return _MainBaseModel;
+ }
+ }
+
+ public class GlobalConfig
+ {
+ public const string RikidHandLeft = "LeftHandRender/RKHandVisual/Hand_L/left_wrist/left_palm";
+ public const string RikidHandRight = "RightHandRender/RKHandVisual/Hand_R/right_wrist/right_palm";
+ public const string RikidHandRightIndexTip = "RightHandRender/RKHandVisual/Hand_R/right_wrist/right_index_metacarpal/right_index_proximal/right_index_intermediate/right_index_distal/right_index_tip";
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Base/AppConfig.cs.meta b/Assets/Main/Script/Runtime/Base/AppConfig.cs.meta
new file mode 100644
index 0000000..1cc2871
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Base/AppConfig.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 43c9d32ba5934c65bf80d76e35074a1a
+timeCreated: 1741162242
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Base/DomainBase.cs b/Assets/Main/Script/Runtime/Base/DomainBase.cs
new file mode 100644
index 0000000..97fe134
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Base/DomainBase.cs
@@ -0,0 +1,88 @@
+using System;
+using System.Threading.Tasks;
+using Cysharp.Threading.Tasks;
+using Main;
+using Stary.Evo.AudioCore;
+using UnityEngine;
+using UnityEngine.Events;
+using YooAsset;
+
+namespace Stary.Evo
+{
+ ///
+ /// 热更基类,应该继承的基类
+ ///
+ public class DomainBase : MonoBehaviour
+ {
+ public string DomainName { protected get; set; }
+
+ public Transform TransformInfo;
+ protected bool isExit { private get; set; }
+
+ ///
+ /// 触发Domain时,调用该方法
+ ///
+ ///
+ public virtual void OnEnter(string param)
+ {
+ TransformInfo = transform.Find("TransformInfo");
+ }
+
+ ///
+ /// Domain被关闭时,会调该方法
+ ///
+ ///
+ public virtual void OnExit()
+ {
+ isExit = true;
+ AudioCoreManager.StopMusic();
+ MainArchitecture.Interface.GetSystem().StopVideo();
+ MainArchitecture.Interface.GetSystem().KillTalkState();
+ }
+
+
+
+ public virtual async Task OnEnterAsync(string param)
+ {
+ isExit = true;
+ }
+
+ public virtual async Task OnExitAsync()
+ {
+ await ForceUnloadAllAssets();
+ }
+
+ private async void OnDestroy()
+ {
+ // if (!isExit)
+ // {
+ // OnExit();
+ // await OnExitAsync();
+ // }
+
+ }
+
+ // 强制卸载所有资源包,该方法请在合适的时机调用。
+ // 注意:Package在销毁的时候也会自动调用该方法。
+ private async UniTask ForceUnloadAllAssets()
+ {
+ var package = YooAssets.TryGetPackage(DomainName);
+ if (package != null)
+ {
+ var operation = package.UnloadAllAssetsAsync();
+ await operation;
+ await package.DestroyAsync();
+ YooAssets.RemovePackage(DomainName);
+
+ Resources.UnloadUnusedAssets();
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+ Debug.Log($"UnityEvo:{DomainName} 资源包已卸载...");
+ }
+ else
+ {
+ Debug.LogWarning($"UnityEvo:{DomainName} 资源包不存在,请检查是否已经卸载还是卸载异常...");
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Base/DomainBase.cs.meta b/Assets/Main/Script/Runtime/Base/DomainBase.cs.meta
new file mode 100644
index 0000000..a17165a
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Base/DomainBase.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 8923efe3eb184e7f9283f71e2dc4ea10
+timeCreated: 1742540500
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/ClassObjectPool.meta b/Assets/Main/Script/Runtime/ClassObjectPool.meta
new file mode 100644
index 0000000..565c74b
--- /dev/null
+++ b/Assets/Main/Script/Runtime/ClassObjectPool.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 555a223b39dcb90489791ddba86221e6
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Script/Runtime/ClassObjectPool/IClassPool.cs b/Assets/Main/Script/Runtime/ClassObjectPool/IClassPool.cs
new file mode 100644
index 0000000..1ed0f38
--- /dev/null
+++ b/Assets/Main/Script/Runtime/ClassObjectPool/IClassPool.cs
@@ -0,0 +1,136 @@
+using System.Collections.Generic;
+using UnityEngine;
+using YooAsset;
+
+namespace Main
+{
+ ///
+ /// 类对象池
+ ///
+ public interface IClassPool
+ {
+ ///
+ /// 将类对象存进池里
+ ///
+ ///
+ void Creation(GameObject obj);
+ ///
+ /// 从未激活池里面取类对象,并放入激活池
+ ///
+ ///
+ GameObject Spawn(Transform parent);
+ ///
+ /// 从激活池中释放类对象到未激活池中
+ ///
+ GameObject RecycleSpawn(GameObject obj);
+ ///
+ /// 回收类对象
+ ///
+ ///
+ ///
+
+ ///
+ /// 清空类对象池
+ ///
+ void RecycleAll();
+
+ int GetPolLength();
+ }
+ public class ClassObjectPool:IClassPool
+ {
+ private AssetHandle poolObject;
+
+ ///
+ /// 回收对象的父物体
+ ///
+ private Transform recycle;
+
+ protected List activepool = new List();
+ protected Stack inactivepool = new Stack();
+ //没有回收的个数
+ protected int noRecycleCount;
+
+ public ClassObjectPool(AssetHandle poolObject,Transform recycle)
+ {
+ this.poolObject = poolObject;
+ this.recycle = recycle;
+ }
+ ///
+ /// 将类对象存进池里
+ ///
+ ///
+ public void Creation(GameObject obj)
+ {
+ inactivepool.Push(obj);
+ noRecycleCount++;
+ }
+
+
+
+ ///
+ /// 从未激活池里面取类对象,并放入激活池
+ ///
+ /// 如果为空是否new出来
+ public GameObject Spawn(Transform parent)
+ {
+ GameObject obj = null;
+ if(noRecycleCount>0)
+ {
+ obj = inactivepool.Pop();
+ obj.transform.SetParent(parent);
+ noRecycleCount--;
+ if(obj==null)
+ Debug.LogErrorFormat("对象池中不存在此对象【{0}】请排查代码", obj);
+ }
+ else
+ {
+ obj= poolObject.InstantiateSync(parent);
+ }
+ obj.transform.localPosition = Vector3.zero;
+ obj.transform.localRotation = Quaternion.identity;
+ obj.transform.localScale = Vector3.one;
+ obj.SetActive(true);
+ activepool.Add(obj);
+
+ return obj;
+ }
+ ///
+ /// 从激活池中释放类对象到未激活池中
+ ///
+ public GameObject RecycleSpawn(GameObject obj)
+ {
+ if(obj!=null&&activepool.Contains(obj))
+ {
+ activepool.Remove(obj);
+ inactivepool.Push(obj);
+ obj.transform.parent = recycle;
+ obj.gameObject.SetActive(false);
+ noRecycleCount++;
+ }
+ return null;
+ }
+
+ ///
+ /// 清空类对象池
+ ///
+ public void RecycleAll()
+ {
+ noRecycleCount=0;
+
+ foreach (var pool in inactivepool)
+ {
+ GameObject.Destroy(pool);
+ }
+ inactivepool.Clear();
+ foreach (var pool in activepool)
+ {
+ GameObject.Destroy(pool);
+ }
+ activepool.Clear();
+ }
+ public int GetPolLength()
+ {
+ return inactivepool.Count;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/ClassObjectPool/IClassPool.cs.meta b/Assets/Main/Script/Runtime/ClassObjectPool/IClassPool.cs.meta
new file mode 100644
index 0000000..b9a6c42
--- /dev/null
+++ b/Assets/Main/Script/Runtime/ClassObjectPool/IClassPool.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: a4fc6b70fe91726439cc0d19d7e92edc
+timeCreated: 1626164240
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Data.meta b/Assets/Main/Script/Runtime/Data.meta
new file mode 100644
index 0000000..239d685
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Data.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 08e4dd259b2cfef419fa885222c533b1
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Script/Runtime/Data/PointGatherData.cs b/Assets/Main/Script/Runtime/Data/PointGatherData.cs
new file mode 100644
index 0000000..f873084
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Data/PointGatherData.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "PointGatherData", menuName = "Evo/Create PointGatherData")]
+public class PointGatherData : ScriptableObject
+{
+ public List ZoneDatas;
+
+ [SerializeField]
+ private GameObject targetGameObject;
+}
+///
+/// 区域数据
+///
+[Serializable]
+public class ZoneData
+{
+ public int id;
+ public string name;
+ public string desc;
+ public string spriteName;
+ public Vector3 position;
+ public Vector3 rotation;
+ public Vector3 scale;
+ public List pointDatas;
+}
+///
+/// 点位数据
+///
+[Serializable]
+public class PointData
+{
+ public int id;
+ public string name;
+ public Vector3 position;
+ public Vector3 rotation;
+ public Vector3 scale;
+ public string desc;
+}
diff --git a/Assets/Main/Script/Runtime/Data/PointGatherData.cs.meta b/Assets/Main/Script/Runtime/Data/PointGatherData.cs.meta
new file mode 100644
index 0000000..e1f0714
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Data/PointGatherData.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 79b808b96820ad546951a6859e2a99be
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Script/Runtime/Enum.meta b/Assets/Main/Script/Runtime/Enum.meta
new file mode 100644
index 0000000..c070e9c
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Enum.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: d6e6dd49414a42798be9ca333f1d433e
+timeCreated: 1744883587
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Enum/Mode.cs b/Assets/Main/Script/Runtime/Enum/Mode.cs
new file mode 100644
index 0000000..0abd65e
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Enum/Mode.cs
@@ -0,0 +1,8 @@
+public enum ZoneType
+{
+ X_02,
+ X_03,
+ X_04,
+ X_05,
+ X_06,
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Enum/Mode.cs.meta b/Assets/Main/Script/Runtime/Enum/Mode.cs.meta
new file mode 100644
index 0000000..f9309f6
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Enum/Mode.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 71a657f436a24eb182bc89d7d8abd80d
+timeCreated: 1744883618
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Fsm.meta b/Assets/Main/Script/Runtime/Fsm.meta
new file mode 100644
index 0000000..05191c1
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Fsm.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 0346f4dcafef4fe7b87b5db6881b56e1
+timeCreated: 1741164620
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Fsm/FsmLoadSystem.cs b/Assets/Main/Script/Runtime/Fsm/FsmLoadSystem.cs
new file mode 100644
index 0000000..02ee445
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Fsm/FsmLoadSystem.cs
@@ -0,0 +1,17 @@
+namespace Stary.Evo
+{
+ public class FsmLoadSystem : FsmSystem , IFsmSystem
+ {
+ private OpenDomainType OpenDomainType { get; set; }
+
+
+ public void SetOpenDomainType(OpenDomainType type)
+ {
+ this.OpenDomainType = type;
+ }
+ public OpenDomainType GetOpenDomainType()
+ {
+ return this.OpenDomainType;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Fsm/FsmLoadSystem.cs.meta b/Assets/Main/Script/Runtime/Fsm/FsmLoadSystem.cs.meta
new file mode 100644
index 0000000..03813f4
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Fsm/FsmLoadSystem.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 1f012ae5832b467a802b8d775b1dae1e
+timeCreated: 1744710396
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Fsm/HotFixState.cs b/Assets/Main/Script/Runtime/Fsm/HotFixState.cs
new file mode 100644
index 0000000..3855467
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Fsm/HotFixState.cs
@@ -0,0 +1,257 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using Cysharp.Threading.Tasks;
+using HybridCLR;
+using UnityEngine;
+using YooAsset;
+
+namespace Stary.Evo
+{
+ public class HotFixState : AbstractFSMIState
+ {
+ public string[] PatchedAOTAssemblyList = new string[]
+ {
+ "System.Core.dll",
+ "UnityEngine.CoreModule.dll",
+ "mscorlib.dll",
+ "DOTween.dll",
+ "InformationSave.RunTime.dll",
+ "UIFarme.RunTime.dll",
+ "UniTask.dll",
+ "YooAsset.dll",
+ "com.stary.evo.runtime.dll"
+
+ };
+ public HotFixState(IFsmSystem system) : base(system)
+ {
+ }
+
+ public override async UniTask OnEnterAsync(T param)
+ {
+ DomainConfig domainConfig = param as DomainConfig;
+ Debug.Log("UnityEvo:热更脚本...");
+ var package = YooAssets.GetPackage(AppConfig.ASSETPACKGENAME);
+ // Editor环境下,HotUpdate.dll.bytes已经被自动加载,不需要加载,重复加载反而会出问题。
+
+
+ // 添加类型存在性检查
+ string fullClassName = $"{domainConfig.@namespace}.{domainConfig.className}";
+
+#if EDITOR_SIMULATEMODE
+ // Editor下无需加载,直接查找获得HotUpdate程序集
+ Assembly hotUpdateAss = System.AppDomain.CurrentDomain.GetAssemblies()
+ .First(a => a.GetName().Name == $"HotUpdate_{AppConfig.ASSETPACKGENAME}");
+#else
+ string hotUpdateAssemblyName = $"HotUpdate_{AppConfig.ASSETPACKGENAME}";
+
+
+ Type assemblyType = IsAssetLoaded(fullClassName);
+ if (assemblyType!=null)
+ {
+ Debug.Log($"UnityEvo:热更程序集:{hotUpdateAssemblyName} 已经加载过了");
+ FsmSystem.SetCurState(nameof(LoadResState), domainConfig, assemblyType);
+ return;
+ }
+
+
+ //判断DLL是否下载成功
+ foreach (var aot in PatchedAOTAssemblyList)
+ {
+ var aotName = $"Android_{aot}";
+ var handle = package.LoadAssetAsync(aotName);
+ await handle;
+ if (handle.Status == EOperationStatus.Succeed)
+ {
+ var assetObj = handle.AssetObject as TextAsset;
+ _sAssetDatas.Add(assetObj);
+ Debug.Log($"UnityEvo:dll:{aotName} ,下载成功");
+ }
+ else
+ {
+ Debug.Log($"UnityEvo:dll:{aotName} ,下载失败");
+ }
+ }
+
+ //先补元数据
+ LoadMetadataForAOTAssemblies();
+
+ // 加载热更dll
+ var hotfixDll = package.LoadAssetAsync($"Android_HotUpdate_{AppConfig.ASSETPACKGENAME}.dll");
+ await hotfixDll;
+ var hotfixPdb = package.LoadAssetAsync($"Android_HotUpdate_{AppConfig.ASSETPACKGENAME}.pdb");
+ await hotfixPdb;
+ Assembly hotUpdateAss = null;
+ if (hotfixDll.Status == EOperationStatus.Succeed)
+ {
+ var hotfixDllAsset = hotfixDll.AssetObject as TextAsset;
+ if (hotfixPdb.Status == EOperationStatus.Succeed)
+ {
+ Debug.Log($"UnityEvo:dll:加载成功!!");
+ var hotfixPdbAsset = hotfixPdb.AssetObject as TextAsset;
+ hotUpdateAss = Assembly.Load(hotfixDllAsset.bytes, hotfixPdbAsset.bytes);
+ }
+ else
+ {
+ if (hotfixDllAsset != null)
+ hotUpdateAss = Assembly.Load(hotfixDllAsset.bytes);
+ }
+ }
+ else
+ {
+ Debug.LogError($"UnityEvo:Android_HotUpdate_{AppConfig.ASSETPACKGENAME}.dll加载失败!!!!!");
+ }
+
+
+#endif
+ if (hotUpdateAss != null)
+ {
+
+ Type type = hotUpdateAss.GetType(fullClassName);
+
+ if (type == null)
+ {
+ Debug.LogError($"UnityEvo:热更类不存在!程序集: {hotUpdateAss.FullName}\n" +
+ $"期望类名: {fullClassName}\n" +
+ $"可用类型列表:{string.Join("\n", hotUpdateAss.GetTypes().Select(t => t.FullName))}");
+ return;
+ }
+
+ // 添加方法存在性检查
+ MethodInfo onEnterMethod = type.GetMethod("OnEnter");
+ MethodInfo onEnterAsyncMethod = type.GetMethod("OnEnterAsync");
+
+ if (onEnterMethod == null || onEnterAsyncMethod == null)
+ {
+ Debug.LogError($"UnityEvo:热更类进入方法缺失!\n" +
+ $"存在方法:{string.Join(", ", type.GetMethods().Select(m => m.Name))}");
+ return;
+ }
+
+ MethodInfo onExitMethod = type.GetMethod("OnExit");
+ MethodInfo onExitAsyncMethod = type.GetMethod("OnExitAsync");
+ if (onExitMethod == null || onExitAsyncMethod == null)
+ {
+ Debug.LogError($"UnityEvo:热更类退出方法缺失!\n" +
+ $"存在方法:{string.Join(", ", type.GetMethods().Select(m => m.Name))}");
+ return;
+ }
+ Debug.Log($"UnityEvo:dll:Type检查成功!!");
+ // AppConfig.SetDefaultHotfixType(type);
+ FsmSystem.SetCurState(nameof(LoadResState), domainConfig, type);
+ // // 创建热更类实例
+ // DomainBase hotfixInstance = AppConfig.HOTFIXBASE.AddComponent(type) as DomainBase;
+ //
+ // if (hotfixInstance == null)
+ // {
+ // Debug.LogError($"热更类{fullClassName}实例创建失败!必须继承MonoBehaviour");
+ // return;
+ // }
+ //
+ //
+ // // 原有调用逻辑修改为使用实例
+ // onEnterMethod.Invoke(hotfixInstance, new object[] { "" }); // 第一个参数改为实例对象
+ // onEnterAsyncMethod.Invoke(hotfixInstance, new object[] { "" });
+ }
+ else
+ {
+ Debug.LogError($"UnityEvo:热更类不存在!程序集: hotUpdateAss 不存在\n" +
+ $"期望类名: {fullClassName}\n" +
+ $"可用类型列表:{string.Join("\n", hotUpdateAss.GetTypes().Select(t => t.FullName))}");
+ }
+ }
+
+ public override UniTask OnEnterAsync()
+ {
+ return UniTask.CompletedTask;
+ }
+
+ public override UniTask OnEnterAsync(T1 param1, T2 param2)
+ {
+ return UniTask.CompletedTask;
+ }
+
+ #region 补充元数据
+
+ // //补充元数据dll的列表
+ // //通过RuntimeApi.LoadMetadataForAOTAssembly()函数来补充AOT泛型的原始元数据
+ // private List AOTMetaAssemblyFiles { get; } =new()
+ // {
+ // "Android_mscorlib.dll", "Android_System.dll", "Android_System.Core.dll",
+ // };
+
+ private readonly List _sAssetDatas = new List();
+
+
+ // public byte[] ReadBytesFromStreamingAssets(string dllName)
+ // {
+ // if (_sAssetDatas.ContainsKey(dllName))
+ // {
+ // return _sAssetDatas[dllName].bytes;
+ // }
+ //
+ // return Array.Empty();
+ // }
+
+
+ ///
+ /// 为aot assembly加载原始metadata, 这个代码放aot或者热更新都行。
+ /// 一旦加载后,如果AOT泛型函数对应native实现不存在,则自动替换为解释模式执行
+ ///
+ private void LoadMetadataForAOTAssemblies()
+ {
+ HomologousImageMode mode = HomologousImageMode.SuperSet;
+ // foreach (var aotDllName in AOTGenericReferences.PatchedAOTAssemblyList)
+ foreach (var aotDll in _sAssetDatas)
+ {
+ // var aotName = $"Android_{aotDllName}";
+ //
+ // byte[] dllBytes = ReadBytesFromStreamingAssets(aotName);
+ if (aotDll != null)
+ {
+ byte[] dllBytes = aotDll.bytes;
+ // 添加元数据加载校验
+ if (dllBytes == null || dllBytes.Length == 0)
+ {
+ Debug.LogError($"AOT元数据加载失败:{aotDll.name}");
+ continue;
+ }
+
+ LoadImageErrorCode err = HybridCLR.RuntimeApi.LoadMetadataForAOTAssembly(dllBytes, mode);
+
+ Debug.Log($"UnityEvo:【补元】{aotDll.name} 加载结果: {err} 字节数: {dllBytes.Length}");
+ }
+ }
+ }
+
+ #endregion
+
+ private Type IsAssetLoaded(string assemblyName)
+ {
+ var assemblies = AppDomain.CurrentDomain.GetAssemblies();
+ foreach (var assembly in assemblies)
+ {
+ Type assemblyType = assembly.GetType(assemblyName);
+ if (assemblyType!=null)
+ {
+
+ Debug.Log("type:" + assemblyType);
+ return assemblyType;
+ }
+ }
+ return null;
+ }
+
+ public override void OnUpdate()
+ {
+ base.OnUpdate();
+ }
+
+ public override UniTask OnExitAsync()
+ {
+ _sAssetDatas.Clear();
+ return UniTask.CompletedTask;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Fsm/HotFixState.cs.meta b/Assets/Main/Script/Runtime/Fsm/HotFixState.cs.meta
new file mode 100644
index 0000000..ae61829
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Fsm/HotFixState.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 693e2ecffc1b43caa7c7818e3aba708c
+timeCreated: 1741165298
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Fsm/LoadResMainState.cs b/Assets/Main/Script/Runtime/Fsm/LoadResMainState.cs
new file mode 100644
index 0000000..4b199e2
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Fsm/LoadResMainState.cs
@@ -0,0 +1,88 @@
+using Cysharp.Threading.Tasks;
+using Main;
+using UnityEngine;
+using YooAsset;
+
+namespace Stary.Evo
+{
+ public class LoadResMainState : AbstractFSMIState
+ {
+ private string _doMain = "Main";
+
+ public LoadResMainState(IFsmSystem system) : base(system)
+ {
+ }
+
+
+
+ public override async UniTask OnEnterAsync()
+ {
+ Debug.Log("加载资源...");
+ var package = YooAssets.GetPackage(_doMain);
+
+ DomainConfig config = null;
+ //加载热更配置文件
+ var loadHotfixSettingsOp = package.LoadAssetAsync("Config_DomainConfig");
+ await loadHotfixSettingsOp;
+ if (loadHotfixSettingsOp.Status == EOperationStatus.Succeed)
+ {
+ //更新成功
+ Debug.Log($"UnityEvo:加载主配置文件 loadHotfixSettings : 【成功】");
+ config = loadHotfixSettingsOp.AssetObject as DomainConfig;
+ }
+ else
+ {
+ Debug.LogError($"UnityEvo:加载主配置文件 loadHotfixSettings : 【失败】");
+ }
+
+ // 加载热更资源
+ var loadOperation = package.LoadAssetAsync(config.mainPrefab);
+
+ await loadOperation;
+ if (loadOperation.Status == EOperationStatus.Succeed)
+ {
+ GameObject loadhotfix = loadOperation.InstantiateSync();
+ AppConfig.SetDefaultMainInstance(loadhotfix);
+ if (loadhotfix != null)
+ {
+ DomainBase hotfixInstance = loadhotfix.GetComponent();
+ if (hotfixInstance == null)
+ {
+ hotfixInstance = loadhotfix.AddComponent();
+ }
+
+ if (hotfixInstance == null)
+ {
+ Debug.LogError($"热更类{loadhotfix.name}实例创建失败!必须继承MonoBehaviour");
+ return;
+ }
+
+
+ // 原有调用逻辑修改为使用实例
+ hotfixInstance.OnEnter("");
+ hotfixInstance.OnEnterAsync("");
+ }
+ }
+ }
+
+ public override UniTask OnEnterAsync(T param)
+ {
+ return UniTask.CompletedTask;
+ }
+ public override UniTask OnEnterAsync(T1 param1, T2 param2)
+ {
+ return UniTask.CompletedTask;
+ }
+ public override void OnUpdate()
+ {
+ base.OnUpdate();
+ }
+
+
+
+ public override UniTask OnExitAsync()
+ {
+ return UniTask.CompletedTask;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Fsm/LoadResMainState.cs.meta b/Assets/Main/Script/Runtime/Fsm/LoadResMainState.cs.meta
new file mode 100644
index 0000000..1f01cbc
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Fsm/LoadResMainState.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: c0fed0de80c04e7fb0f513ce21fed7b9
+timeCreated: 1744361114
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Fsm/LoadResState.cs b/Assets/Main/Script/Runtime/Fsm/LoadResState.cs
new file mode 100644
index 0000000..a6e27fb
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Fsm/LoadResState.cs
@@ -0,0 +1,92 @@
+using System;
+using Cysharp.Threading.Tasks;
+using Stary.Evo.InformationSave;
+using UnityEngine;
+using YooAsset;
+
+namespace Stary.Evo
+{
+ public class LoadResState : AbstractFSMIState
+ {
+ public GameObject mainPrefab;
+
+ public LoadResState(IFsmSystem system) : base(system)
+ {
+ }
+
+
+ public override UniTask OnEnterAsync()
+ {
+ return UniTask.CompletedTask;
+ }
+
+ public override UniTask OnEnterAsync(T param)
+ {
+ return UniTask.CompletedTask;
+ }
+
+ public override async UniTask OnEnterAsync(T1 param1, T2 param2)
+ {
+ Debug.Log("加载资源...");
+ DomainConfig domainConfig = param1 as DomainConfig;
+ Type type = param2 as Type;
+ var package = YooAssets.GetPackage(domainConfig.domain);
+
+ // 加载热更资源
+ var loadOperation = package.LoadAssetAsync(domainConfig.mainPrefab);
+
+ await loadOperation;
+ if (loadOperation.Status == EOperationStatus.Succeed)
+ {
+ mainPrefab = loadOperation.InstantiateSync();
+ LocalTransformInfo info = mainPrefab.GetComponentInChildren();
+ FsmLoadSystem fsmLoadSystem = FsmSystem as FsmLoadSystem;
+
+ if (fsmLoadSystem.GetOpenDomainType() == OpenDomainType.DEFAULT)
+ {
+ info.Switch(0);
+ }
+ else if (fsmLoadSystem.GetOpenDomainType() == OpenDomainType.VIOICE)
+ {
+ info.Switch(1);
+ }
+ if (mainPrefab != null)
+ {
+ DomainBase hotfixInstance = mainPrefab.GetComponent(type) as DomainBase;
+ if (hotfixInstance == null)
+ {
+ hotfixInstance = mainPrefab.AddComponent(type) as DomainBase;
+ }
+
+ hotfixInstance.DomainName = domainConfig.domain;
+ if (hotfixInstance == null)
+ {
+ Debug.LogError($"热更类{type.Name}实例创建失败!必须继承MonoBehaviour");
+ return;
+ }
+
+
+ // 原有调用逻辑修改为使用实例
+ hotfixInstance.OnEnter("");
+ hotfixInstance.OnEnterAsync("");
+ }
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ base.OnUpdate();
+ }
+
+
+
+ public override async UniTask OnExitAsync()
+ {
+ Debug.Log("UnityEvo:Domain退出...");
+ DomainBase domainBase = mainPrefab.GetComponent();
+ domainBase.OnExit();
+ await domainBase.OnExitAsync();
+ GameObject.Destroy(domainBase.gameObject);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Fsm/LoadResState.cs.meta b/Assets/Main/Script/Runtime/Fsm/LoadResState.cs.meta
new file mode 100644
index 0000000..70f5020
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Fsm/LoadResState.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: f689e40cd4654793a8f1d3ce69ba3532
+timeCreated: 1741165763
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Fsm/ResStartState.cs b/Assets/Main/Script/Runtime/Fsm/ResStartState.cs
new file mode 100644
index 0000000..9c23063
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Fsm/ResStartState.cs
@@ -0,0 +1,247 @@
+using System;
+using Cysharp.Threading.Tasks;
+using Newtonsoft.Json;
+using UnityEditor;
+using UnityEngine;
+using UnityEngine.Assertions;
+using UnityEngine.Networking;
+using YooAsset;
+
+namespace Stary.Evo
+{
+ public class ResStartState : AbstractFSMIState
+ {
+ public ResStartState(IFsmSystem system) : base(system)
+ {
+ }
+
+
+
+
+ public override async UniTask OnEnterAsync()
+ {
+ Debug.Log("UnityEvo:启动开始资源初始化...");
+
+
+ //初始化读取资源配置表
+ HotfixMainResDomain hotfixMainResDomain = Resources.Load("HotfixMainResDomain");
+ if (hotfixMainResDomain != null)
+ {
+ AppConfig.IPCONFIG = hotfixMainResDomain.hotfixMainResDomainEntity.ipconfig;
+ AppConfig.USERNAME = hotfixMainResDomain.hotfixMainResDomainEntity.username;
+ AppConfig.PASSWORD = hotfixMainResDomain.hotfixMainResDomainEntity.password;
+ }
+ Debug.Log($"UnityEvo:读取资源配置表成功...{ AppConfig.IPCONFIG}{AppConfig.USERNAME}{AppConfig.PASSWORD}");
+ // 初始化资源系统
+ YooAssets.Initialize();
+
+
+ //自定义网络请求器
+ // 设置自定义请求委托
+ YooAssets.SetDownloadSystemUnityWebRequest(NasWebRequester);
+
+
+ //初始化资源加载模块
+ // 增加包存在性检查
+ var package = YooAssets.TryGetPackage(AppConfig.ASSETPACKGENAME);
+ if (package == null)
+ {
+ Debug.LogWarning($"UnityEvo:资源包 {AppConfig.ASSETPACKGENAME} 不存在,正在尝试创建...");
+ package = YooAssets.CreatePackage(AppConfig.ASSETPACKGENAME);
+ }
+
+ YooAssets.SetDefaultPackage(package);
+
+ // 初始化资源包
+#if EDITOR_SIMULATEMODE
+ await EDITOR_SIMULATEMODE(package);
+ AppConfig.IPCONFIGVideo = "http://192.168.31.100:9527/";
+#elif OFFLINE_PLAYMODE
+ await OFFLINE_PLAYMODE(package);
+ AppConfig.IPCONFIGVideo = Application.streamingAssetsPath + "/";
+
+#elif HOST_PLAYMODE
+ if (package.PackageName.Equals("Main"))
+ {
+ await OFFLINE_PLAYMODE(package);
+ }
+ else
+ {
+ await HOST_PLAYMODE(package);
+ }
+
+ AppConfig.IPCONFIGVideo = "http://192.168.31.100:9527/";
+#elif WEB_PLAYMODE
+ // IRemoteServices remoteServices = new RemoteServices(defaultHostServer, fallbackHostServer);
+ // var webServerFileSystemParams = FileSystemParameters.CreateDefaultWebServerFileSystemParameters();
+ // var webRemoteFileSystemParams =
+ // FileSystemParameters.CreateDefaultWebRemoteFileSystemParameters(remoteServices); //支持跨域下载
+ //
+ // var initParameters = new WebPlayModeParameters();
+ // initParameters.WebServerFileSystemParameters = webServerFileSystemParams;
+ // initParameters.WebRemoteFileSystemParameters = webRemoteFileSystemParams;
+ //
+ // var initOperation = package.InitializeAsync(initParameters);
+ // await initOperation;
+ //
+ // if (initOperation.Status == EOperationStatus.Succeed)
+ // Debug.Log("UnityEvo:资源包初始化成功!");
+ // else
+ // Debug.LogError($"UnityEvo:资源包初始化失败:{initOperation.Error}");
+
+ Debug.LogError($"UnityEvo:暂不支持");
+#endif
+
+ FsmSystem.SetCurState(nameof(ResUpdateServerState));
+ }
+
+ public override UniTask OnEnterAsync(T param)
+ {
+ return UniTask.CompletedTask;
+ }
+ public override UniTask OnEnterAsync(T1 param1, T2 param2)
+ {
+ return UniTask.CompletedTask;
+ }
+ public override void OnUpdate()
+ {
+ base.OnUpdate();
+ }
+
+
+
+ public override UniTask OnExitAsync()
+ {
+ return UniTask.CompletedTask;
+ }
+
+ private async UniTask EDITOR_SIMULATEMODE(ResourcePackage package)
+ {
+ var buildResult = EditorSimulateModeHelper.SimulateBuild(AppConfig.ASSETPACKGENAME);
+ var packageRoot = buildResult.PackageRootDirectory;
+ var editorFileSystemParameters = FileSystemParameters.CreateDefaultEditorFileSystemParameters(packageRoot);
+ var initParams = new EditorSimulateModeParameters();
+ initParams.EditorFileSystemParameters = editorFileSystemParameters;
+ var initialization = package.InitializeAsync(initParams);
+ await initialization;
+ if (initialization.Status == EOperationStatus.Succeed)
+ {
+ Assert.AreEqual(EOperationStatus.Succeed, initialization.Status);
+ Debug.Log("UnityEvo:资源包初始化成功!");
+ }
+ else
+ {
+ Debug.LogError($"UnityEvo:资源包初始化失败:{initialization.Error}");
+ }
+ }
+
+ private async UniTask OFFLINE_PLAYMODE(ResourcePackage package)
+ {
+ var buildinFileSystemParams = FileSystemParameters.CreateDefaultBuildinFileSystemParameters();
+ var initParameters = new OfflinePlayModeParameters();
+ initParameters.BuildinFileSystemParameters = buildinFileSystemParams;
+ var initOperation = package.InitializeAsync(initParameters);
+ await initOperation;
+
+ if (initOperation.Status == EOperationStatus.Succeed)
+ Debug.Log("UnityEvo:从本地加载资源包,初始化成功!");
+ else
+ Debug.LogError($"UnityEvo:从本地加载资源包,初始化失败:{initOperation.Error}");
+ }
+
+ public async UniTask HOST_PLAYMODE(ResourcePackage package)
+ {
+ // 新增平台判断代码
+#if UNITY_EDITOR
+ BuildTarget buildTarget = UnityEditor.EditorUserBuildSettings.activeBuildTarget;
+ string platformName = buildTarget.ToString();
+#else
+ string platformName = Application.platform.ToString();
+#endif
+ Debug.Log($"目标平台标识: {platformName}");
+ //从服务器加载配置列表
+ WebRequestSystem webRequestSystem = new WebRequestSystem();
+ string URL =
+ $"{AppConfig.IPCONFIG}/HybridclrConfigData/{AppConfig.ASSETPACKGENAME}/{platformName}/{Application.productName}.json";
+ Debug.Log("UnityEvo: 服务器配置文件地址:" + URL);
+ string text = await webRequestSystem.Get(URL, GetAuthorization(AppConfig.USERNAME, AppConfig.PASSWORD));
+ if (!string.IsNullOrEmpty(text))
+ {
+ try
+ {
+ Debug.Log("UnityEvo: 服务器配置文件读取成功:" + text);
+ text = text.Trim('\uFEFF'); // 移除 BOM 字符
+ HotfixMainResDomainEntity hotfixMainResDomainEntity =
+ JsonConvert.DeserializeObject(text);
+ if (hotfixMainResDomainEntity != null &&
+ hotfixMainResDomainEntity.domain == AppConfig.ASSETPACKGENAME)
+ {
+ AppConfig.IPCONFIG = hotfixMainResDomainEntity.ipconfig;
+ AppConfig.PATHCONFIG = hotfixMainResDomainEntity.pathconfig;
+ AppConfig.ASSETPACKGENAME = hotfixMainResDomainEntity.domain;
+ }
+ else
+ {
+ throw new Exception("服务器配置文件中Domain与指定domain不匹配,进程中断,请排查:" + AppConfig.ASSETPACKGENAME);
+ }
+ }
+ catch (JsonException e)
+ {
+ Debug.LogError($"UnityEvo:JSON解析失败: {e.Message}\n原始内容: {text}");
+ }
+ }
+ else
+ {
+ Debug.LogError("UnityEvo:从服务器获取的配置数据为空");
+ }
+
+
+ string defaultHostServer = $"{AppConfig.IPCONFIG}/{AppConfig.PATHCONFIG}";
+ string fallbackHostServer = $"{AppConfig.IPCONFIG}/{AppConfig.PATHCONFIG}";
+
+ Debug.Log($"UnityEvo:正在初始化远程资源包,主服务器:{defaultHostServer}");
+ // 在初始化下载器前添加证书验证配置
+
+
+ var initParameters = new HostPlayModeParameters();
+ IRemoteServices remoteServices = new RemoteServices(defaultHostServer, fallbackHostServer);
+ var cacheFileSystemParams = FileSystemParameters.CreateDefaultCacheFileSystemParameters(remoteServices);
+ cacheFileSystemParams.AddParameter(FileSystemParametersDefine.APPEND_FILE_EXTENSION, true);
+
+ var buildinFileSystemParams = FileSystemParameters.CreateDefaultBuildinFileSystemParameters();
+ buildinFileSystemParams.AddParameter(FileSystemParametersDefine.APPEND_FILE_EXTENSION, true);
+ buildinFileSystemParams.AddParameter(FileSystemParametersDefine.COPY_BUILDIN_PACKAGE_MANIFEST, true);
+ initParameters.BuildinFileSystemParameters = null;
+ initParameters.CacheFileSystemParameters = cacheFileSystemParams;
+
+ var initOperation = package.InitializeAsync(initParameters);
+
+ await initOperation;
+
+ if (initOperation.Status == EOperationStatus.Succeed)
+ Debug.Log("UnityEvo:从远程加载资源包,初始化成功!");
+ else
+ Debug.LogError($"UnityEvo:从远程加载资源包,初始化失败:{initOperation.Error}");
+ }
+
+ ///
+ /// 自定义网络请求器需要登录
+ ///
+ ///
+ ///
+ private UnityWebRequest NasWebRequester(string url)
+ {
+ var request = new UnityWebRequest(url, UnityWebRequest.kHttpVerbGET);
+ var authorization = GetAuthorization(AppConfig.USERNAME, AppConfig.PASSWORD);
+ request.SetRequestHeader("AUTHORIZATION", authorization);
+ return request;
+ }
+
+ private string GetAuthorization(string userName, string password)
+ {
+ string auth = userName + ":" + password;
+ var bytes = System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(auth);
+ return "Basic " + System.Convert.ToBase64String(bytes);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Fsm/ResStartState.cs.meta b/Assets/Main/Script/Runtime/Fsm/ResStartState.cs.meta
new file mode 100644
index 0000000..9ac9b55
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Fsm/ResStartState.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 2462c737fc9c4b53b35557f8a6aac453
+timeCreated: 1741165298
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Fsm/ResUpdateLocalState.cs b/Assets/Main/Script/Runtime/Fsm/ResUpdateLocalState.cs
new file mode 100644
index 0000000..b17add4
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Fsm/ResUpdateLocalState.cs
@@ -0,0 +1,132 @@
+using Cysharp.Threading.Tasks;
+using UnityEngine;
+using UnityEngine.Assertions;
+using YooAsset;
+
+namespace Stary.Evo
+{
+ public class ResUpdateLocalState : AbstractFSMIState
+ {
+
+
+ public ResUpdateLocalState(IFsmSystem system) : base(system)
+ {
+ }
+
+
+
+
+
+ public override async UniTask OnEnterAsync()
+ {
+ //初始化读取资源配置表
+ var package = YooAssets.GetPackage(AppConfig.ASSETPACKGENAME);
+
+
+ //更新失败
+
+ Debug.Log($"UnityEvo:切换为加载本地缓存资源...");
+
+ // 获取上次成功记录的版本
+ string packageVersion = PlayerPrefs.GetString("GAME_VERSION", string.Empty);
+ if (string.IsNullOrEmpty(packageVersion))
+ {
+ Debug.Log($"UnityEvo:没有找到本地版本记录,需要更新资源!");
+ return;
+ }
+
+ Debug.Log($"UnityEvo:获取资源版本 Version : 【{packageVersion}】");
+ Debug.Log($"UnityEvo:开始加载本地资源...");
+ // Assert.AreEqual(EOperationStatus.Succeed, requetVersionOp.Status);
+
+
+ // 加载本地缓存的资源清单文件
+ var updateManifestOp = package.UpdatePackageManifestAsync(packageVersion);
+ await updateManifestOp;
+ if (updateManifestOp.Status == EOperationStatus.Succeed)
+ {
+ //更新成功
+ Debug.Log($"UnityEvo:更新本地资源清单 updateManifest : 【成功】");
+ }
+ else
+ {
+ //更新失败
+ Debug.LogError($"UnityEvo:加载本地资源清单文件失败,需要更新资源!: 【{updateManifestOp.Error}】");
+ return;
+ }
+
+ Assert.AreEqual(EOperationStatus.Succeed, updateManifestOp.Status);
+
+
+ //4.下载补丁包
+ await Download();
+
+
+ //加载热更配置文件
+ var loadHotfixSettingsOp = package.LoadAssetAsync("Config_DomainConfig");
+ await loadHotfixSettingsOp;
+ DomainConfig domainConfig = null;
+ if (loadHotfixSettingsOp.Status == EOperationStatus.Succeed)
+ {
+ //更新成功
+ Debug.Log($"UnityEvo:加载热更配置文件 DomainConfig : 【成功】");
+ domainConfig = loadHotfixSettingsOp.AssetObject as DomainConfig;
+ }
+ else
+ {
+ Debug.LogError($"UnityEvo:加载热更配置文件 DomainConfig : 【失败】");
+ }
+
+ if (package.PackageName.Equals("Main"))
+ {
+ FsmSystem.SetCurState(nameof(LoadResMainState));
+ }
+ else
+ {
+ if (domainConfig == null)
+ {
+ Debug.LogError($"UnityEvo:【{package.PackageName}】加载DomainConfig为空,无法继续执行后续流程,请检查!!!");
+ }
+ FsmSystem.SetCurState(nameof(HotFixState), domainConfig);
+ }
+ }
+
+ public override UniTask OnEnterAsync(T param)
+ {
+ return UniTask.CompletedTask;
+ }
+ public override UniTask OnEnterAsync(T1 param1, T2 param2)
+ {
+ return UniTask.CompletedTask;
+ }
+ public override void OnUpdate()
+ {
+ base.OnUpdate();
+ }
+
+
+ public override UniTask OnExitAsync()
+ {
+ return UniTask.CompletedTask;
+ }
+
+ #region 下载热更资源
+
+ public async UniTask Download()
+ {
+ int downloadingMaxNum = 1;
+ int failedTryAgain = 1;
+ var package = YooAssets.GetPackage(AppConfig.ASSETPACKGENAME);
+ var downloader = package.CreateResourceDownloader(downloadingMaxNum, failedTryAgain);
+
+ // 在正常开始游戏之前,还需要验证本地清单内容的完整性。
+ if (downloader.TotalDownloadCount > 0)
+ {
+ Debug.Log("UnityEvo:资源内容本地并不完整,需要更新资源!");
+ return;
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Fsm/ResUpdateLocalState.cs.meta b/Assets/Main/Script/Runtime/Fsm/ResUpdateLocalState.cs.meta
new file mode 100644
index 0000000..7cfcdb9
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Fsm/ResUpdateLocalState.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: eca158039896455dba3ded1eb703a5da
+timeCreated: 1742291100
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Fsm/ResUpdateServerState.cs b/Assets/Main/Script/Runtime/Fsm/ResUpdateServerState.cs
new file mode 100644
index 0000000..8d76df5
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Fsm/ResUpdateServerState.cs
@@ -0,0 +1,214 @@
+using Cysharp.Threading.Tasks;
+using UnityEngine;
+using UnityEngine.Assertions;
+using YooAsset;
+
+namespace Stary.Evo
+{
+ public class ResUpdateServerState : AbstractFSMIState
+ {
+
+
+
+ public ResUpdateServerState(IFsmSystem system) : base(system)
+ {
+ }
+
+ public override async UniTask OnEnterAsync()
+ {
+ Debug.Log("UnityEvo:开始资源更新...");
+
+
+ // //初始化读取资源配置表
+ var package = YooAssets.GetPackage(AppConfig.ASSETPACKGENAME);
+ // 请求资源版本
+ var requetVersionOp = package.RequestPackageVersionAsync();
+ await requetVersionOp;
+ string packageVersion = "";
+ if (requetVersionOp.Status == EOperationStatus.Succeed)
+ {
+ //更新成功
+ packageVersion = requetVersionOp.PackageVersion;
+ PlayerPrefs.SetString("GAME_VERSION", packageVersion);
+ Debug.Log($"UnityEvo:获取资源版本 Version : 【{packageVersion}】");
+ Debug.Log($"UnityEvo:开始加载服务器资源...");
+ }
+ else
+ {
+ Debug.LogError($"UnityEvo:获取资源版本失败: 【{requetVersionOp.Error}】");
+ FsmSystem.SetCurState(nameof(ResUpdateLocalState));
+ return;
+ }
+
+ // Assert.AreEqual(EOperationStatus.Succeed, requetVersionOp.Status);
+
+
+ // 更新资源清单
+ var updateManifestOp = package.UpdatePackageManifestAsync(packageVersion);
+ await updateManifestOp;
+ if (updateManifestOp.Status == EOperationStatus.Succeed)
+ {
+ //更新成功
+ Debug.Log($"UnityEvo:更新资源清单 updateManifest : 【成功】");
+ }
+ else
+ {
+ //更新失败
+ Debug.LogError($"UnityEvo:更新资源清单失败: 【{updateManifestOp.Error}】");
+ }
+
+ Assert.AreEqual(EOperationStatus.Succeed, updateManifestOp.Status);
+
+
+
+
+ //4.下载补丁包
+ await Download();
+
+
+
+
+ //加载热更配置文件
+ var loadHotfixSettingsOp = package.LoadAssetAsync("Config_DomainConfig");
+ await loadHotfixSettingsOp;
+ DomainConfig domainConfig = null;
+ if (loadHotfixSettingsOp.Status == EOperationStatus.Succeed)
+ {
+ //更新成功
+ Debug.Log($"UnityEvo:加载热更配置文件 loadHotfixSettings : 【成功】");
+ domainConfig = loadHotfixSettingsOp.AssetObject as DomainConfig;
+ }
+ else
+ {
+ Debug.LogError($"UnityEvo:加载热更配置文件 loadHotfixSettings : 【失败】");
+ }
+
+ if (package.PackageName.Equals("Main"))
+ {
+ FsmSystem.SetCurState(nameof(LoadResMainState));
+ }
+ else
+ {
+ if (domainConfig == null)
+ {
+ Debug.LogError($"UnityEvo:【{package.PackageName}】加载DomainConfig为空,无法继续执行后续流程,请检查!!!");
+ }
+ FsmSystem.SetCurState(nameof(HotFixState), domainConfig);
+ }
+ }
+ public override UniTask OnEnterAsync(T param)
+ {
+ return UniTask.CompletedTask;
+ }
+ public override UniTask OnEnterAsync(T1 param1, T2 param2)
+ {
+ return UniTask.CompletedTask;
+ }
+ public override void OnUpdate()
+ {
+ base.OnUpdate();
+ }
+
+
+
+ public override UniTask OnExitAsync()
+ {
+ return UniTask.CompletedTask;
+ }
+
+ #region 下载热更资源
+
+ public async UniTask Download()
+ {
+ // 在任意MonoBehaviour或DomainBase派生类中
+ string[] andUnzipAsyncPath= await ZipTool.DownloadAndUnzipAsync(
+ $"{AppConfig.IPCONFIG}/XOSMOPlug_inLibrary/{AppConfig.ASSETPACKGENAME}/Android/1.0.5/X_02_01_1.0.5.zip",
+ Application.persistentDataPath + "/DownloadedContent",
+ progress => Debug.Log($"下载进度:{progress:P0}"),
+ progress => Debug.Log($"解压进度:{progress:P0}")
+ );
+ var package = YooAssets.GetPackage(AppConfig.ASSETPACKGENAME);
+ var downloader = package.CreateResourceImporter(andUnzipAsyncPath, 3, 3);
+
+
+
+
+ // int downloadingMaxNum = 10;
+ // int failedTryAgain = 3;
+ // var package = YooAssets.GetPackage(AppConfig.ASSETPACKGENAME);
+ // var downloader = package.CreateResourceDownloader(downloadingMaxNum, failedTryAgain);
+
+ // //没有需要下载的资源
+ // if (downloader.TotalDownloadCount == 0)
+ // {
+ // Debug.Log("UnityEvo:没有需要下载的资源,跳过更新");
+ // return;
+ // }
+ //
+ // //需要下载的文件总数和总大小
+ // int totalDownloadCount = downloader.TotalDownloadCount;
+ // long totalDownloadBytes = downloader.TotalDownloadBytes;
+ // Debug.Log($"UnityEvo:需要下载的资源的个数【{totalDownloadCount}】,需要下载的资源的总大小{totalDownloadBytes/1024} MB");
+ // //===================================适应新版本YooAsset插件的修改===================================
+ // //注册回调方法
+ // downloader.DownloadErrorCallback = OnDownloadErrorFunction;
+ // downloader.DownloadUpdateCallback = OnDownloadProgressUpdateFunction;
+ // downloader.DownloadFinishCallback = OnDownloadOverFunction;
+ // downloader.DownloadFileBeginCallback = OnStartDownloadFileFunction;
+ // //===================================适应新版本YooAsset插件的修改===================================
+ //
+ // //开启下载
+ // downloader.BeginDownload();
+ await downloader;
+
+ //检测下载结果
+ if (downloader.Status == EOperationStatus.Succeed)
+ {
+ //下载成功
+ Debug.Log("UnityEvo:资源更新完成");
+ }
+ else
+ {
+ //下载失败
+ Debug.Log("UnityEvo:资源更新失败");
+ }
+ }
+
+ //===================================适应新版本YooAsset插件的修改===================================
+ ///
+ /// 开始下载
+ ///
+ private void OnStartDownloadFileFunction(DownloadFileData downloadFileData)
+ {
+ Debug.Log($"UnityEvo:开始下载:文件名:{downloadFileData.FileName},文件大小:{downloadFileData.FileSize/1024f/1024f} MB");
+ }
+
+ ///
+ /// 下载完成
+ ///
+ private void OnDownloadOverFunction(DownloaderFinishData downloaderFinishData)
+ {
+ Debug.Log("UnityEvo:下载" + (downloaderFinishData.Succeed ? "成功" : "失败"));
+ }
+
+ ///
+ /// 更新中
+ ///
+ private void OnDownloadProgressUpdateFunction(DownloadUpdateData downloadUpdateData)
+ {
+ Debug.Log($"UnityEvo:文件总数:{downloadUpdateData.TotalDownloadCount},已下载文件数:{downloadUpdateData.CurrentDownloadCount},下载总大小:{downloadUpdateData.TotalDownloadBytes/1024f/1024f} MB,已下载大小{downloadUpdateData.CurrentDownloadBytes/1024f/1024f} MB");
+ }
+
+ ///
+ /// 下载出错
+ ///
+ ///
+ private void OnDownloadErrorFunction(DownloadErrorData errorData)
+ {
+ Debug.Log($"UnityEvo:下载出错:包名:{errorData.PackageName} 文件名:{errorData.FileName},错误信息:{errorData.ErrorInfo}");
+ }
+ //===================================适应新版本YooAsset插件的修改===================================
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/Fsm/ResUpdateServerState.cs.meta b/Assets/Main/Script/Runtime/Fsm/ResUpdateServerState.cs.meta
new file mode 100644
index 0000000..f066681
--- /dev/null
+++ b/Assets/Main/Script/Runtime/Fsm/ResUpdateServerState.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: bf15fa0d3ca74b0991fd60bef616d007
+timeCreated: 1741248693
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/HotUpdate.meta b/Assets/Main/Script/Runtime/HotUpdate.meta
new file mode 100644
index 0000000..832f9c8
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HotUpdate.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 45d07e1bb40ffcf4c8d9dc0cc5c31331
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Script/Runtime/HotUpdate/GeneratedConst.cs b/Assets/Main/Script/Runtime/HotUpdate/GeneratedConst.cs
new file mode 100644
index 0000000..9b87949
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HotUpdate/GeneratedConst.cs
@@ -0,0 +1,27 @@
+public class _Const
+{
+ public const int LAYER_DEFAULT = 0;
+ public const int LAYER_TRANSPARENTFX = 1;
+ public const int LAYER_IGNORE_RAYCAST = 2;
+ public const int LAYER_WATER = 4;
+ public const int LAYER_UI = 5;
+ public const int LAYER_LAYER6 = 6;
+ public const int LAYER_LAYER7 = 7;
+ public const int LAYER_LAYER8 = 8;
+ public const int LAYER_LAYER9 = 9;
+ public const int LAYER_LAYER10 = 10;
+ public const int LAYER_LAYER11 = 11;
+ public const int LAYER_LAYER12 = 12;
+ public const int LAYER_LAYER13 = 13;
+ public const int LAYER_LAYER14 = 14;
+ public const int LAYER_LAYER15 = 15;
+ public const int LAYER_LAYER16 = 16;
+ public const int LAYER_LAYER17 = 17;
+ public const string TAG_UNTAGGED = "Untagged";
+ public const string TAG_RESPAWN = "Respawn";
+ public const string TAG_FINISH = "Finish";
+ public const string TAG_EDITORONLY= "EditorOnly";
+ public const string TAG_MAINCAMERA= "MainCamera";
+ public const string TAG_PLAYER = "Player";
+ public const string TAG_GAMECONTROLLER = "GameController";
+}
diff --git a/Assets/Main/Script/Runtime/HotUpdate/GeneratedConst.cs.meta b/Assets/Main/Script/Runtime/HotUpdate/GeneratedConst.cs.meta
new file mode 100644
index 0000000..8e60273
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HotUpdate/GeneratedConst.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 121e5154d8bb6ac49a32eeeadeba3e45
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Script/Runtime/HotUpdate/MainDomain.cs b/Assets/Main/Script/Runtime/HotUpdate/MainDomain.cs
new file mode 100644
index 0000000..753f30e
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HotUpdate/MainDomain.cs
@@ -0,0 +1,61 @@
+using System.Threading.Tasks;
+using Stary.Evo;
+using Stary.Evo.UIFarme;
+using UnityEngine;
+namespace Main
+{
+ public class MainDomain :DomainBase,IController
+ {
+
+ public override void OnEnter(string param)
+ {
+ base.OnEnter(param);
+ Debug.Log("UnityEvo: OnEnter进入成功");
+ }
+
+ public override void OnExit()
+ {
+ base.OnExit();
+ GetArchitecture().Dispose();
+ Debug.Log("UnityEvo: OnExit退出成功");
+ }
+
+ public override Task OnEnterAsync(string param)
+ {
+ Debug.Log("UnityEvo: OnEnterAsync进入成功");
+ this.GetSystem().CreatZone(this.transform);
+ this.GetSystem().LoadKKController(this.transform);
+ return base.OnEnterAsync(param);
+ }
+
+ public override Task OnExitAsync()
+ {
+ Debug.Log("UnityEvo: OnEnterAsync退出成功");
+ return base.OnExitAsync();
+ }
+
+ public void OnDestroy()
+ {
+ GetArchitecture().Dispose();
+ }
+ public IArchitecture GetArchitecture()
+ {
+ return MainArchitecture.Interface;
+ }
+ }
+
+
+ public class MainArchitecture : Architecture
+ {
+ protected override void Init()
+ {
+ //注册示例
+ //RegisterSystem(new ScoreSystem());
+ RegisterData(new ZoneGatherData());
+ RegisterSystem(new ZoneSystem());
+ RegisterSystem(new DigitalHuman());
+ RegisterSystem(new VideoSystem());
+ RegisterSystem(new PanelSystem());
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/HotUpdate/MainDomain.cs.meta b/Assets/Main/Script/Runtime/HotUpdate/MainDomain.cs.meta
new file mode 100644
index 0000000..d9e9478
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HotUpdate/MainDomain.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1b21927e111c22c4b93513b595e9f4a2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Script/Runtime/HotUpdate/PointController.cs b/Assets/Main/Script/Runtime/HotUpdate/PointController.cs
new file mode 100644
index 0000000..776b236
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HotUpdate/PointController.cs
@@ -0,0 +1,77 @@
+using System;
+using System.Collections.Generic;
+using Cysharp.Threading.Tasks;
+using Main;
+using Stary.Evo;
+using UnityEngine;
+using YooAsset;
+
+namespace Main
+{
+ public class PointController : MonoBehaviour, IController
+ {
+ public ZoneController ZoneController;
+ private SphereCollider sphereCollider;
+
+ private IUnRegister _onTriggerEnterUnRegister;
+ private IUnRegister _onTriggerExitUnRegister;
+
+ public void Init(ZoneController ZoneController, PointData pointData)
+ {
+ this.ZoneController = ZoneController;
+ name = pointData.name;
+ //根据数据设置zone 碰撞盒
+ transform.localPosition = pointData.position;
+ transform.localRotation = Quaternion.Euler(pointData.rotation);
+ transform.localScale = pointData.scale;
+ sphereCollider = this.transform.GetOrAddComponent();
+
+ _onTriggerEnterUnRegister = this.OnTriggerEnterEvent(OnPointTriggerEnterEvent);
+ _onTriggerExitUnRegister = this.OnTriggerExitEvent(OnPointriggerExitEvent);
+ this.gameObject.SetActive(false);
+ }
+
+ public void OnPointTriggerEnterEvent(Collider collider)
+ {
+ if (collider.gameObject.CompareTag("MainCamera"))
+ {
+ // ZoneController.OpenPoint(this);
+ Debug.Log("OnPointTriggerEnterEvent");
+ }
+ }
+
+ public void OnPointriggerExitEvent(Collider collider)
+ {
+ if (collider.gameObject.CompareTag("MainCamera"))
+ {
+ // ZoneController.OpenPoint(this);
+ Debug.Log("OnPointTriggerEnterEvent");
+ }
+ }
+
+ public IArchitecture GetArchitecture()
+ {
+ return MainArchitecture.Interface;
+ }
+ }
+
+ public class ZoneColliderEntity
+ {
+ public string Name { get; set; }
+ public BoxCollider ZoneCollider { get; set; }
+
+ public Func EntorComplete { get; set; }
+
+ public Func ExitComplete { get; set; }
+ public PointColliderEntity[] PointColliderEntities { get; set; }
+ }
+
+ public class PointColliderEntity
+ {
+ public string Name { get; set; }
+ public bool IsTrigger { get; set; }
+ public SphereCollider PointCollider { get; set; }
+
+ public Func EntorComplete { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/HotUpdate/PointController.cs.meta b/Assets/Main/Script/Runtime/HotUpdate/PointController.cs.meta
new file mode 100644
index 0000000..85aaac5
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HotUpdate/PointController.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 1d999e82fdea4ce287a59f805605e760
+timeCreated: 1744884916
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/HotUpdate/Res.cs b/Assets/Main/Script/Runtime/HotUpdate/Res.cs
new file mode 100644
index 0000000..cb528f2
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HotUpdate/Res.cs
@@ -0,0 +1,136 @@
+namespace R
+{
+ public class Res
+ {
+ public class Main
+ {
+ public static class anim
+ {
+ public const string vid_maskani_anim = "Anim_vid_maskAni";
+ public const string vid_maskcontroller_controller = "Anim_vid_maskController";
+ public const string vid_maskdefault_anim = "Anim_vid_maskDefault";
+ }
+ public static class audios
+ {
+ public const string au_x_07_ending1_wav = "Audios_au_X_07_ending1";
+ public const string au_x_07_ending2_wav = "Audios_au_X_07_ending2";
+ public const string au_x_07_ending3_wav = "Audios_au_X_07_ending3";
+ public const string au_x_07_ending4_wav = "Audios_au_X_07_ending4";
+ }
+ public static class config
+ {
+ public const string domainconfig_asset = "Config_DomainConfig";
+ }
+ public static class dll
+ {
+ public static class android
+ {
+ public const string com_stary_evo_runtime_dll_bytes = "Android_com.stary.evo.runtime.dll";
+ public const string dotween_dll_bytes = "Android_DOTween.dll";
+ public const string informationsave_runtime_dll_bytes = "Android_InformationSave.RunTime.dll";
+ public const string mscorlib_dll_bytes = "Android_mscorlib.dll";
+ public const string system_core_dll_bytes = "Android_System.Core.dll";
+ public const string uifarme_runtime_dll_bytes = "Android_UIFarme.RunTime.dll";
+ public const string unitask_dll_bytes = "Android_UniTask.dll";
+ public const string unityengine_coremodule_dll_bytes = "Android_UnityEngine.CoreModule.dll";
+ public const string yooasset_dll_bytes = "Android_YooAsset.dll";
+ }
+ }
+ public static class prefabs
+ {
+ public const string guideball_point_prefab = "Prefabs_GuideBall_Point";
+ public const string guideball_zone_prefab = "Prefabs_GuideBall_Zone";
+ public const string kkcontroller_prefab = "Prefabs_KKController";
+ public const string main_prefab = "Prefabs_Main";
+ public const string videopanel_prefab = "Prefabs_VideoPanel";
+ public const string watermark_prefab = "Prefabs_Watermark";
+ }
+ public static class scenes
+ {
+ }
+ public static class spriteatlas
+ {
+ public const string video_spriteatlas = "";
+ public const string vid_video_mask_spriteatlas = "";
+ }
+ public static class sprites
+ {
+ public const string ui_video_kepu_png = "Sprites_ui_video_kepu";
+ public const string ui_x_07_ending1_png = "Sprites_ui_X_07_ending1";
+ public const string ui_x_07_ending2_png = "Sprites_ui_X_07_ending2";
+ public const string ui_x_07_ending3_png = "Sprites_ui_X_07_ending3";
+ public const string ui_zone1_shengmingjiankangqu_png = "Sprites_ui_zone1_shengmingjiankangqu";
+ public const string ui_zone2_jiankangyingxiangyinsuqu_png = "Sprites_ui_zone2_jiankangyingxiangyinsuqu";
+ public const string ui_zone3_shengmingfanghuqu_png = "Sprites_ui_zone3_shengmingfanghuqu";
+ public const string ui_zone4_jiankangsuyangqu_png = "Sprites_ui_zone4_jiankangsuyangqu";
+ public const string ui_zone5_jiankangshenghuofangshiqu_png = "Sprites_ui_zone5_jiankangshenghuofangshiqu";
+ public static class video
+ {
+ }
+ public static class vid_video_mask
+ {
+ public const string vid_mask_001_png = "vid_video_mask_vid_mask_001";
+ public const string vid_mask_002_png = "vid_video_mask_vid_mask_002";
+ public const string vid_mask_003_png = "vid_video_mask_vid_mask_003";
+ public const string vid_mask_004_png = "vid_video_mask_vid_mask_004";
+ public const string vid_mask_005_png = "vid_video_mask_vid_mask_005";
+ public const string vid_mask_006_png = "vid_video_mask_vid_mask_006";
+ public const string vid_mask_007_png = "vid_video_mask_vid_mask_007";
+ public const string vid_mask_008_png = "vid_video_mask_vid_mask_008";
+ public const string vid_mask_009_png = "vid_video_mask_vid_mask_009";
+ public const string vid_mask_010_png = "vid_video_mask_vid_mask_010";
+ public const string vid_mask_011_png = "vid_video_mask_vid_mask_011";
+ public const string vid_mask_012_png = "vid_video_mask_vid_mask_012";
+ public const string vid_mask_013_png = "vid_video_mask_vid_mask_013";
+ public const string vid_mask_014_png = "vid_video_mask_vid_mask_014";
+ public const string vid_mask_015_png = "vid_video_mask_vid_mask_015";
+ public const string vid_mask_016_png = "vid_video_mask_vid_mask_016";
+ public const string vid_mask_017_png = "vid_video_mask_vid_mask_017";
+ public const string vid_mask_018_png = "vid_video_mask_vid_mask_018";
+ public const string vid_mask_019_png = "vid_video_mask_vid_mask_019";
+ public const string vid_mask_020_png = "vid_video_mask_vid_mask_020";
+ public const string vid_mask_021_png = "vid_video_mask_vid_mask_021";
+ public const string vid_mask_022_png = "vid_video_mask_vid_mask_022";
+ public const string vid_mask_023_png = "vid_video_mask_vid_mask_023";
+ public const string vid_mask_024_png = "vid_video_mask_vid_mask_024";
+ public const string vid_mask_025_png = "vid_video_mask_vid_mask_025";
+ public const string vid_mask_026_png = "vid_video_mask_vid_mask_026";
+ public const string vid_mask_027_png = "vid_video_mask_vid_mask_027";
+ public const string vid_mask_028_png = "vid_video_mask_vid_mask_028";
+ public const string vid_mask_029_png = "vid_video_mask_vid_mask_029";
+ public const string vid_mask_030_png = "vid_video_mask_vid_mask_030";
+ public const string vid_mask_031_png = "vid_video_mask_vid_mask_031";
+ public const string vid_mask_032_png = "vid_video_mask_vid_mask_032";
+ public const string vid_mask_033_png = "vid_video_mask_vid_mask_033";
+ public const string vid_mask_034_png = "vid_video_mask_vid_mask_034";
+ public const string vid_mask_035_png = "vid_video_mask_vid_mask_035";
+ public const string vid_mask_036_png = "vid_video_mask_vid_mask_036";
+ public const string vid_mask_037_png = "vid_video_mask_vid_mask_037";
+ public const string vid_mask_038_png = "vid_video_mask_vid_mask_038";
+ public const string vid_mask_039_png = "vid_video_mask_vid_mask_039";
+ public const string vid_mask_040_png = "vid_video_mask_vid_mask_040";
+ public const string vid_mask_041_png = "vid_video_mask_vid_mask_041";
+ public const string vid_mask_042_png = "vid_video_mask_vid_mask_042";
+ public const string vid_mask_043_png = "vid_video_mask_vid_mask_043";
+ public const string vid_mask_044_png = "vid_video_mask_vid_mask_044";
+ public const string vid_mask_045_png = "vid_video_mask_vid_mask_045";
+ public const string vid_mask_046_png = "vid_video_mask_vid_mask_046";
+ public const string vid_mask_047_png = "vid_video_mask_vid_mask_047";
+ public const string vid_mask_048_png = "vid_video_mask_vid_mask_048";
+ public const string vid_mask_049_png = "vid_video_mask_vid_mask_049";
+ public const string vid_mask_050_png = "vid_video_mask_vid_mask_050";
+ public const string vid_mask_051_png = "vid_video_mask_vid_mask_051";
+ public const string vid_mask_052_png = "vid_video_mask_vid_mask_052";
+ public const string vid_mask_053_png = "vid_video_mask_vid_mask_053";
+ public const string vid_mask_054_png = "vid_video_mask_vid_mask_054";
+ public const string vid_mask_055_png = "vid_video_mask_vid_mask_055";
+ public const string vid_mask_056_png = "vid_video_mask_vid_mask_056";
+ public const string vid_mask_057_png = "vid_video_mask_vid_mask_057";
+ public const string vid_mask_058_png = "vid_video_mask_vid_mask_058";
+ public const string vid_mask_059_png = "vid_video_mask_vid_mask_059";
+ public const string vid_mask_060_png = "vid_video_mask_vid_mask_060";
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/HotUpdate/Res.cs.meta b/Assets/Main/Script/Runtime/HotUpdate/Res.cs.meta
new file mode 100644
index 0000000..73a849b
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HotUpdate/Res.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8c2846e6784c72e4186e83c127058adb
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Script/Runtime/HotUpdate/ZoneController.cs b/Assets/Main/Script/Runtime/HotUpdate/ZoneController.cs
new file mode 100644
index 0000000..6aed91b
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HotUpdate/ZoneController.cs
@@ -0,0 +1,124 @@
+using System;
+using Stary.Evo;
+using UnityEngine;
+using UnityEngine.UI;
+using YooAsset;
+
+namespace Main
+{
+ public class ZoneController : MonoBehaviour, IController
+ {
+ public ZoneType zoneType;
+ public BoxCollider ZoneCollider { get; set; }
+ public PointController[] PointControllerEntities { get; set; }
+
+ private IUnRegister _onTriggerEnterUnRegister;
+
+ private Image _image;
+ public async void Init(ZoneData zoneData)
+ {
+
+ name = zoneData.name;
+ zoneType = Enum.Parse(name);
+ _image=transform.Find("Canvas/Image").GetComponent();
+ //根据数据设置zone 碰撞盒
+ transform.localPosition = zoneData.position;
+ transform.localRotation = Quaternion.Euler(zoneData.rotation);
+ transform.localScale = zoneData.scale;
+ ZoneCollider = this.transform.GetOrAddComponent();
+
+ _onTriggerEnterUnRegister = this.OnTriggerEnterEvent(OnZoneTriggerEnterEvent);
+
+ PointControllerEntities = new PointController[zoneData.pointDatas.Count];
+
+ var package = YooAssets.TryGetPackage("Main");
+
+ var spriteHandle = package.LoadAssetAsync($"Sprites_{zoneData.spriteName}" );
+ await spriteHandle.Task;
+ _image.sprite = spriteHandle.GetAssetObject();
+ _image.SetNativeSize();
+
+ var pointHandle = package.LoadAssetAsync(R.Res.Main.prefabs.guideball_point_prefab);
+ await pointHandle.Task;
+ for (int i = 0; i < zoneData.pointDatas.Count; i++)
+ {
+
+ PointData currentPointData = zoneData.pointDatas[i];
+ var pointGo = pointHandle.InstantiateSync(this.transform);
+ PointController pointController = pointGo.GetOrAddComponent();
+ PointControllerEntities[i] = pointController;
+ pointController.Init(this, currentPointData);
+
+
+ this.GetSystem().AddPointData(new DigitalHumanPointData()
+ {
+ Name = zoneData.pointDatas[i].name,
+ pointTransform = pointGo.transform
+ });
+ }
+ // this.RegisterEvent(zoneType, OpenPoint);
+ }
+
+
+ public void OnZoneTriggerEnterEvent(Collider collider)
+ {
+ Debug.Log("OnZoneTriggerEnterEvent");
+ if (collider.gameObject.CompareTag("MainCamera"))
+ {
+ _onTriggerEnterUnRegister.UnRegister();
+ OpenPoint();
+ this.GetSystem().OpenCurrentZone(this);
+ }
+ }
+
+ public void OpenPoint()
+ {
+ foreach (var controller in PointControllerEntities)
+ {
+ controller.gameObject.SetActive(true);
+ }
+ }
+
+ public void OpenPoint(PointController controller)
+ {
+ foreach (var controllerEntity in PointControllerEntities)
+ {
+ if (controllerEntity == controller)
+ {
+ controller.gameObject.SetActive(true);
+ }
+ else
+ {
+ controllerEntity.gameObject.SetActive(false);
+ }
+
+ }
+ }
+
+ public void ColsePoint()
+ {
+ foreach (var controller in PointControllerEntities)
+ {
+ controller.gameObject.SetActive(false);
+ }
+ }
+
+ public void OnZoneTriggerExitEvent(Collider collider)
+ {
+ }
+
+ public void OnPointTriggerEnterEvent(Collider collider)
+ {
+ }
+
+ public void OnPointTriggerExitEvent(Collider collider)
+ {
+ }
+
+ public IArchitecture GetArchitecture()
+ {
+ return MainArchitecture.Interface;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/HotUpdate/ZoneController.cs.meta b/Assets/Main/Script/Runtime/HotUpdate/ZoneController.cs.meta
new file mode 100644
index 0000000..7045356
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HotUpdate/ZoneController.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 5f2837f45bfd4347b76957e11fd63f6b
+timeCreated: 1744876130
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/HotUpdate/ZoneGatherData.cs b/Assets/Main/Script/Runtime/HotUpdate/ZoneGatherData.cs
new file mode 100644
index 0000000..df219b9
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HotUpdate/ZoneGatherData.cs
@@ -0,0 +1,160 @@
+using System.Collections;
+using System.Collections.Generic;
+using Stary.Evo;
+using UnityEngine;
+
+namespace Main
+{
+ public interface IZoneData : IData
+ {
+ ZoneData[] GetZoneDataAll();
+ ZoneData GetZoneData(int id);
+ ZoneData GetZoneData(string domain);
+ PointData GetPointData(int zoneId, int pointId);
+ PointData GetPointData(string zoneDomain, string pointDomain);
+ }
+
+
+ public class ZoneGatherData : AbstractData, IZoneData
+ {
+ private PointGatherData _pointGatherData;
+
+ protected override void OnInit()
+ {
+ _pointGatherData = Resources.Load("PointGatherData");
+ }
+
+ ///
+ /// 通过id获取区域数据
+ ///
+ ///
+ ///
+ public ZoneData[] GetZoneDataAll()
+ {
+ if (_pointGatherData != null)
+ {
+ for (int i = 0; i < _pointGatherData.ZoneDatas.Count; i++)
+ {
+
+ return _pointGatherData.ZoneDatas.ToArray();
+
+ }
+
+ Debug.LogWarning($"UnityEvo:PointGatherData is null");
+ }
+ else
+ {
+ Debug.LogError("UnityEvo:PointGatherData is null");
+ }
+
+ return default;
+ }
+
+ ///
+ /// 通过id获取区域数据
+ ///
+ ///
+ ///
+ public ZoneData GetZoneData(int id)
+ {
+ if (_pointGatherData != null)
+ {
+ for (int i = 0; i < _pointGatherData.ZoneDatas.Count; i++)
+ {
+ if (_pointGatherData.ZoneDatas[i].id == id)
+ {
+ return _pointGatherData.ZoneDatas[i];
+ }
+ }
+
+ Debug.LogWarning($"UnityEvo:{id}在PointGatherData is null");
+ }
+ else
+ {
+ Debug.LogError("UnityEvo:PointGatherData is null");
+ }
+
+ return default;
+ }
+
+ ///
+ /// 通过id获取区域数据
+ ///
+ ///
+ ///
+ public ZoneData GetZoneData(string domain)
+ {
+ if (_pointGatherData != null)
+ {
+ for (int i = 0; i < _pointGatherData.ZoneDatas.Count; i++)
+ {
+ if (_pointGatherData.ZoneDatas[i].name == domain)
+ {
+ return _pointGatherData.ZoneDatas[i];
+ }
+ }
+
+ Debug.LogWarning($"UnityEvo:{domain}在PointGatherData is null");
+ }
+ else
+ {
+ Debug.LogError("UnityEvo:PointGatherData is null");
+ }
+
+ return default;
+ }
+
+ public PointData GetPointData(int zoneId, int pointId)
+ {
+ ZoneData zoneData = GetZoneData(zoneId);
+ if (zoneData.pointDatas != null)
+ {
+ for (int i = 0; i < zoneData.pointDatas.Count; i++)
+ {
+ if (zoneData.pointDatas[i].id == pointId)
+ {
+ return zoneData.pointDatas[i];
+ }
+ }
+
+ Debug.LogWarning($"UnityEvo:{pointId}在PointGatherData.zoneData.pointDatas is null");
+ }
+ else
+ {
+ Debug.LogError("UnityEvo:PointGatherData.zoneData.pointDatas is null");
+ }
+
+ return default;
+ }
+
+ public PointData GetPointData(string zoneDomain, string pointDomain)
+ {
+ ZoneData zoneData = GetZoneData(zoneDomain);
+ if (zoneData.pointDatas != null)
+ {
+ for (int i = 0; i < zoneData.pointDatas.Count; i++)
+ {
+ if (zoneData.pointDatas[i].name == pointDomain)
+ {
+ return zoneData.pointDatas[i];
+ }
+ }
+
+ Debug.LogWarning($"UnityEvo:{pointDomain}在PointGatherData.zoneData.pointDatas is null");
+ }
+ else
+ {
+ Debug.LogError("UnityEvo:PointGatherData.zoneData.pointDatas is null");
+ }
+
+ return default;
+ }
+
+ public override void Dispose()
+ {
+
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/HotUpdate/ZoneGatherData.cs.meta b/Assets/Main/Script/Runtime/HotUpdate/ZoneGatherData.cs.meta
new file mode 100644
index 0000000..dbf6ad8
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HotUpdate/ZoneGatherData.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 23cb528afab304d429cd1873c3ec2281
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Script/Runtime/HotUpdate/ZoneSystem.cs b/Assets/Main/Script/Runtime/HotUpdate/ZoneSystem.cs
new file mode 100644
index 0000000..0f27ef1
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HotUpdate/ZoneSystem.cs
@@ -0,0 +1,59 @@
+using System.Collections;
+using System.Collections.Generic;
+using Stary.Evo;
+using UnityEngine;
+using YooAsset;
+
+namespace Main
+{
+ public interface IZoneSystem : ISystem
+ {
+ void CreatZone(Transform parent);
+ void OpenCurrentZone(ZoneController CurrentController);
+ }
+
+ public class ZoneSystem : AbstractSystem, IZoneSystem
+ {
+ private ZoneController[] zoneControllers;
+
+ protected override void OnInit()
+ {
+
+ }
+
+ ///
+ /// 创建zone碰撞盒
+ ///
+ public async void CreatZone(Transform parent)
+ {
+ var package = YooAssets.TryGetPackage("Main");
+ var pointHandle = package.LoadAssetAsync(R.Res.Main.prefabs.guideball_zone_prefab);
+ await pointHandle.Task;
+ var zoneDatas = this.GetData().GetZoneDataAll();
+ zoneControllers = new ZoneController[zoneDatas.Length];
+ for (int i = 0; i < zoneDatas.Length; i++)
+ {
+ var zoneGo = pointHandle.InstantiateSync(parent);
+ ZoneController pointController = zoneGo.GetOrAddComponent();
+ zoneControllers[i] = pointController;
+ pointController.Init(zoneDatas[i]);
+ }
+ }
+
+ public void OpenCurrentZone(ZoneController CurrentController)
+ {
+ foreach (var controller in zoneControllers)
+ {
+ if (controller != CurrentController)
+ {
+ controller.ColsePoint();
+ }
+ }
+ }
+
+ public override void Dispose()
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Main/Script/Runtime/HotUpdate/ZoneSystem.cs.meta b/Assets/Main/Script/Runtime/HotUpdate/ZoneSystem.cs.meta
new file mode 100644
index 0000000..a9ecb85
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HotUpdate/ZoneSystem.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c0daf3dc0256eff458e570c61418625b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Script/Runtime/HybridCLRGenerate.meta b/Assets/Main/Script/Runtime/HybridCLRGenerate.meta
new file mode 100644
index 0000000..ba6fac8
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HybridCLRGenerate.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 3196c042bce6e4f41b144335b4bfd000
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Main/Script/Runtime/HybridCLRGenerate/AOTGenericReferences.cs b/Assets/Main/Script/Runtime/HybridCLRGenerate/AOTGenericReferences.cs
new file mode 100644
index 0000000..9bb79f8
--- /dev/null
+++ b/Assets/Main/Script/Runtime/HybridCLRGenerate/AOTGenericReferences.cs
@@ -0,0 +1,587 @@
+using System.Collections.Generic;
+public class AOTGenericReferences : UnityEngine.MonoBehaviour
+{
+
+ // {{ AOT assemblies
+ public static readonly IReadOnlyList PatchedAOTAssemblyList = new List
+ {
+ "DOTween.dll",
+ "InformationSave.RunTime.dll",
+ "UIFarme.RunTime.dll",
+ "UniTask.dll",
+ "UnityEngine.CoreModule.dll",
+ "YooAsset.dll",
+ "com.stary.evo.runtime.dll",
+ "mscorlib.dll",
+ };
+ // }}
+
+ // {{ constraint implement type
+ // }}
+
+ // {{ AOT generic types
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask.<>cd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask.<>cd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask.<>cd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask.<>cd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask.<>cd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask.<>cd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask.<>cd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask.<>cd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask.<>cd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask.<>cd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask.<>cd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask.<>cd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask.<>cd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskd__2>
+ // Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskd__2>
+ // Cysharp.Threading.Tasks.ITaskPoolNode