mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-11-11 00:36:00 +00:00
提交
This commit is contained in:
@@ -29,8 +29,21 @@ MonoBehaviour:
|
||||
AssetTags:
|
||||
ActiveRuleName: EnableGroup
|
||||
Collectors:
|
||||
- CollectPath: Assets/HotResources
|
||||
CollectorGUID: 9cf7250c4c4b62c4ea6c677e2007ec5a
|
||||
- CollectPath: Assets/HotResources/ResResource
|
||||
CollectorGUID: 41b6813a035e0034e8584e4ddf38a71c
|
||||
CollectorType: 0
|
||||
AddressRuleName: AddressByFileName
|
||||
PackRuleName: PackSeparately
|
||||
FilterRuleName: CollectAll
|
||||
AssetTags:
|
||||
UserData:
|
||||
- GroupName: Launcher
|
||||
GroupDesc:
|
||||
AssetTags: Launcher
|
||||
ActiveRuleName: EnableGroup
|
||||
Collectors:
|
||||
- CollectPath: Assets/HotResources/ResLauncher
|
||||
CollectorGUID: 01324e397f8b57046883e895c3c119fe
|
||||
CollectorType: 0
|
||||
AddressRuleName: AddressByFileName
|
||||
PackRuleName: PackSeparately
|
||||
@@ -47,11 +60,53 @@ MonoBehaviour:
|
||||
Groups:
|
||||
- GroupName: HotDlls
|
||||
GroupDesc:
|
||||
AssetTags:
|
||||
AssetTags: HotDlls
|
||||
ActiveRuleName: EnableGroup
|
||||
Collectors:
|
||||
- CollectPath: Assets/HotAssets/HotDlls
|
||||
CollectorGUID: dac7bc99d1e678248a1a3539ac15a567
|
||||
- CollectPath: Assets/HotAssets/HotDlls/HotSamples.dll.bytes
|
||||
CollectorGUID: 31ecfccf5f58fcd4e82c0039b5c0433e
|
||||
CollectorType: 0
|
||||
AddressRuleName: AddressByFileName
|
||||
PackRuleName: PackRawFile
|
||||
FilterRuleName: CollectAll
|
||||
AssetTags:
|
||||
UserData:
|
||||
- GroupName: Launcher
|
||||
GroupDesc:
|
||||
AssetTags: Launcher
|
||||
ActiveRuleName: EnableGroup
|
||||
Collectors:
|
||||
- CollectPath: Assets/HotAssets/HotDlls/GameLauncher.dll.bytes
|
||||
CollectorGUID: 6c68d6e82f75ac9418cacb027f3c7298
|
||||
CollectorType: 0
|
||||
AddressRuleName: AddressByFileName
|
||||
PackRuleName: PackRawFile
|
||||
FilterRuleName: CollectAll
|
||||
AssetTags:
|
||||
UserData:
|
||||
- GroupName: AOT
|
||||
GroupDesc:
|
||||
AssetTags: AOT
|
||||
ActiveRuleName: EnableGroup
|
||||
Collectors:
|
||||
- CollectPath: Assets/HotAssets/HotDlls/mscorlib.dll.bytes
|
||||
CollectorGUID: c4f581dc739cf6048af0a89b137378bc
|
||||
CollectorType: 0
|
||||
AddressRuleName: AddressByFileName
|
||||
PackRuleName: PackRawFile
|
||||
FilterRuleName: CollectAll
|
||||
AssetTags:
|
||||
UserData:
|
||||
- CollectPath: Assets/HotAssets/HotDlls/System.Core.dll.bytes
|
||||
CollectorGUID: 1025cdbe997285647b72636669abf317
|
||||
CollectorType: 0
|
||||
AddressRuleName: AddressByFileName
|
||||
PackRuleName: PackRawFile
|
||||
FilterRuleName: CollectAll
|
||||
AssetTags:
|
||||
UserData:
|
||||
- CollectPath: Assets/HotAssets/HotDlls/System.dll.bytes
|
||||
CollectorGUID: 946433c0616922f408bd60ce93af2f95
|
||||
CollectorType: 0
|
||||
AddressRuleName: AddressByFileName
|
||||
PackRuleName: PackRawFile
|
||||
|
||||
BIN
JNFrame2/Assets/HotAssets/HotDlls/GameLauncher.dll.bytes
Normal file
BIN
JNFrame2/Assets/HotAssets/HotDlls/GameLauncher.dll.bytes
Normal file
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6c68d6e82f75ac9418cacb027f3c7298
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
19
JNFrame2/Assets/HotMain/HotMain.asmdef
Normal file
19
JNFrame2/Assets/HotMain/HotMain.asmdef
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "HotMain",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:f51ebe6a0ceec4240a699833d6309b23",
|
||||
"GUID:e34a5702dd353724aa315fb8011f08c3",
|
||||
"GUID:23aed7c57bb0a5d49aeaef92abb5bfff",
|
||||
"GUID:13ba8ce62aa80c74598530029cb2d649"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
7
JNFrame2/Assets/HotMain/HotMain.asmdef.meta
Normal file
7
JNFrame2/Assets/HotMain/HotMain.asmdef.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 00b62574639528e40bdd0ce0d013db67
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -38,7 +38,7 @@ RenderSettings:
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1}
|
||||
m_IndirectSpecularColor: {r: 0.12731749, g: 0.13414757, b: 0.1210787, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
@@ -147,14 +147,15 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 67180524}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1371077986}
|
||||
- {fileID: 296179531}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &67180526
|
||||
MonoBehaviour:
|
||||
@@ -168,7 +169,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: f47aaf5c712947a69bb25051c81a1be1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &790008994
|
||||
--- !u!1 &296179530
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -176,92 +177,42 @@ GameObject:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 790008996}
|
||||
- component: {fileID: 790008995}
|
||||
- component: {fileID: 296179531}
|
||||
- component: {fileID: 296179532}
|
||||
m_Layer: 0
|
||||
m_Name: Directional Light
|
||||
m_Name: UI
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!108 &790008995
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 790008994}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 10
|
||||
m_Type: 1
|
||||
m_Shape: 0
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_InnerSpotAngle: 21.80208
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_CullingMatrixOverride:
|
||||
e00: 1
|
||||
e01: 0
|
||||
e02: 0
|
||||
e03: 0
|
||||
e10: 0
|
||||
e11: 1
|
||||
e12: 0
|
||||
e13: 0
|
||||
e20: 0
|
||||
e21: 0
|
||||
e22: 1
|
||||
e23: 0
|
||||
e30: 0
|
||||
e31: 0
|
||||
e32: 0
|
||||
e33: 1
|
||||
m_UseCullingMatrixOverride: 0
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingLayerMask: 1
|
||||
m_Lightmapping: 4
|
||||
m_LightShadowCasterMode: 0
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_UseBoundingSphereOverride: 0
|
||||
m_UseViewFrustumForShadowCasterCull: 1
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &790008996
|
||||
--- !u!4 &296179531
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 790008994}
|
||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_GameObject: {fileID: 296179530}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
m_Father: {fileID: 67180525}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &296179532
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 296179530}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a847b1151d044df183a7ab4fe052112f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &1371077985
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -286,13 +237,13 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1371077985}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 67180525}
|
||||
m_RootOrder: -2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1371077987
|
||||
MonoBehaviour:
|
||||
@@ -314,7 +265,7 @@ MonoBehaviour:
|
||||
- HotMain.SHGame.Procedure.ProcedureUpdatePackageManifest
|
||||
- HotMain.SHGame.Procedure.ProcedureUpdatePackageVersion
|
||||
m_EntranceProcedureTypeName: HotMain.SHGame.Procedure.ProcedureInitializePackage
|
||||
--- !u!1 &1371947665
|
||||
--- !u!1 &1460349557
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -322,34 +273,39 @@ GameObject:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1371947668}
|
||||
- component: {fileID: 1371947667}
|
||||
- component: {fileID: 1371947666}
|
||||
- component: {fileID: 1460349560}
|
||||
- component: {fileID: 1460349559}
|
||||
- component: {fileID: 1460349558}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Name: Stage Camera
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &1371947666
|
||||
AudioListener:
|
||||
--- !u!114 &1460349558
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1371947665}
|
||||
m_GameObject: {fileID: 1460349557}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &1371947667
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 367e80e3fa958344491a9a196a902b72, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
constantSize: 1
|
||||
--- !u!20 &1460349559
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1371947665}
|
||||
m_GameObject: {fileID: 1460349557}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_ClearFlags: 3
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
@@ -371,40 +327,40 @@ Camera:
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
near clip plane: -30
|
||||
far clip plane: 30
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic: 1
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_Depth: 1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_Bits: 32
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_TargetEye: 0
|
||||
m_HDR: 0
|
||||
m_AllowMSAA: 0
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &1371947668
|
||||
--- !u!4 &1460349560
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1371947665}
|
||||
m_GameObject: {fileID: 1460349557}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalPosition: {x: 8.688524, y: -5, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1994723394
|
||||
GameObject:
|
||||
@@ -450,11 +406,18 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1994723394}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1660057539 &9223372036854775807
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
m_Roots:
|
||||
- {fileID: 1460349560}
|
||||
- {fileID: 67180525}
|
||||
- {fileID: 1994723396}
|
||||
|
||||
14
JNFrame2/Assets/HotMain/HotMainEvent.cs
Normal file
14
JNFrame2/Assets/HotMain/HotMainEvent.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace HotMain
|
||||
{
|
||||
public class HotMainEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// 开始下载资源
|
||||
/// </summary>
|
||||
public static string StartDownloader = "HotMainEvent_StartDownloader";
|
||||
/// <summary>
|
||||
/// 下载资源中进度更新 totalCount, currentCount, totalBytes, currentBytes
|
||||
/// </summary>
|
||||
public static string DownloaderProgressUpdate = "HotMainEvent_DownloaderProgressUpdate";
|
||||
}
|
||||
}
|
||||
3
JNFrame2/Assets/HotMain/HotMainEvent.cs.meta
Normal file
3
JNFrame2/Assets/HotMain/HotMainEvent.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 426c2f9b87234b1c962c020f4ed21c68
|
||||
timeCreated: 1729012045
|
||||
@@ -21,7 +21,7 @@ namespace HotMain.SHGame.Procedure
|
||||
//热更新的dll名称
|
||||
public static readonly string[] HotDllName =
|
||||
{
|
||||
"HotSamples.dll"
|
||||
"HotSamples.dll",
|
||||
};
|
||||
|
||||
public static readonly string[] AotMetaAssemblyFiles =
|
||||
|
||||
@@ -21,11 +21,34 @@ namespace HotMain.SHGame.Procedure
|
||||
|
||||
private async UniTask CreatePackageDownloader(IFsm<IProcedureManager> procedureOwner)
|
||||
{
|
||||
|
||||
// 打包时内置在包体内的资源 直接先使用包体资源,实例化 登录加载界面后,再去检查是否需要下载更新
|
||||
//加载AOT
|
||||
await LoadMetadataForAOTAssemblies();
|
||||
|
||||
//加载GameLauncher dll
|
||||
#if !UNITY_EDITOR
|
||||
_launcherAss = await LoadHotfixDll(ProcedureInitializePackage.RawFilePackageName, "GameLauncher.dll");
|
||||
#else
|
||||
_launcherAss = AppDomain.CurrentDomain.GetAssemblies().First(a => a.GetName().Name == "GameLauncher");
|
||||
Log.Warning("加载热更dll:GameLauncher.dll");
|
||||
#endif
|
||||
|
||||
//切换到更新资源版本
|
||||
ChangeState<ProcedurePackageDownloader>(procedureOwner);
|
||||
|
||||
}
|
||||
|
||||
public static async UniTask<Assembly> LoadHotfixDll(string packageName, string name)
|
||||
{
|
||||
Log.Warning($"加载热更dll:{name}");
|
||||
var package = YooAssets.GetPackage(packageName);
|
||||
var handle = package.LoadRawFileAsync(name);
|
||||
await handle.ToUniTask();
|
||||
var dllBytes = handle.GetRawFileData();
|
||||
var assembly = Assembly.Load(dllBytes);
|
||||
Log.Warning($"加载热更dll完成:{name}");
|
||||
return assembly;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using System;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using SHFrame;
|
||||
using SHFrame.FSM;
|
||||
using UnityEngine;
|
||||
using YooAsset;
|
||||
using EventArgs = SHFrame.EventArgs;
|
||||
|
||||
namespace HotMain.SHGame.Procedure
|
||||
{
|
||||
@@ -12,27 +15,71 @@ namespace HotMain.SHGame.Procedure
|
||||
|
||||
private int totalDownloadCount = 0;
|
||||
private long totalDownloadBytes = 0;
|
||||
|
||||
private IFsm<IProcedureManager> Procedure;
|
||||
private bool isStartDownloader = false;
|
||||
|
||||
protected override void OnEnter(IFsm<IProcedureManager> procedureOwner)
|
||||
{
|
||||
|
||||
Procedure = procedureOwner;
|
||||
|
||||
base.OnEnter(procedureOwner);
|
||||
|
||||
launcherPatchCount = 0;
|
||||
totalDownloadCount = 0;
|
||||
totalDownloadBytes = 0;
|
||||
Download(procedureOwner);
|
||||
|
||||
//监听开始下载
|
||||
EventUtil.AddListener(HotMainEvent.StartDownloader,OnStartDownloader);
|
||||
|
||||
//打开Launcher
|
||||
RunLauncher().Forget();
|
||||
|
||||
}
|
||||
|
||||
protected override void OnLeave(IFsm<IProcedureManager> procedureOwner, bool isShutdown)
|
||||
{
|
||||
base.OnLeave(procedureOwner, isShutdown);
|
||||
|
||||
EventUtil.RemoveListener(HotMainEvent.StartDownloader,OnStartDownloader);
|
||||
}
|
||||
|
||||
public async UniTask RunLauncher()
|
||||
{
|
||||
|
||||
//打开LauncherMain
|
||||
var package = YooAssets.GetPackage(ProcedureInitializePackage.DefaultPackageName);
|
||||
var handle = package.LoadAssetAsync<GameObject>("HotLauncher");
|
||||
await handle.ToUniTask();
|
||||
var hotLauncher = handle.InstantiateSync();
|
||||
hotLauncher.name = $"HotLauncher_{package.GetPackageVersion()}";
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void OnStartDownloader(EventArgs eventargs)
|
||||
{
|
||||
Download(Procedure);
|
||||
}
|
||||
|
||||
|
||||
private async void Download(IFsm<IProcedureManager> procedureOwner)
|
||||
{
|
||||
// //检查launcher标签的资源
|
||||
// launcherPatchCount += TryGetTagPatchCount(ProcedureInitializePackage.RawFilePackageName, YooTag.LAUNCHER);
|
||||
// launcherPatchCount += TryGetTagPatchCount(ProcedureInitializePackage.DefaultPackageName, YooTag.LAUNCHER);
|
||||
//
|
||||
// if (launcherPatchCount > 0)
|
||||
// {
|
||||
// Log.Warning("launcher资源需要更新,下载完成后需要重启游戏");
|
||||
// totalDownloadCount += launcherPatchCount;
|
||||
// }
|
||||
|
||||
if (isStartDownloader) return;
|
||||
|
||||
isStartDownloader = true;
|
||||
|
||||
//检查launcher标签的资源
|
||||
launcherPatchCount += TryGetTagPatchCount(ProcedureInitializePackage.RawFilePackageName, "Launcher");
|
||||
launcherPatchCount += TryGetTagPatchCount(ProcedureInitializePackage.DefaultPackageName, "Launcher");
|
||||
|
||||
if (launcherPatchCount > 0)
|
||||
{
|
||||
Log.Warning("launcher资源需要更新,下载完成后需要重启游戏");
|
||||
totalDownloadCount += launcherPatchCount;
|
||||
}
|
||||
|
||||
// 完全通过远端获取的资源,每次启动游戏都检查是否需要更新
|
||||
//TODO 把这个玩意拆分成 1、获取下载文件大小,2、提示总的下载大小,提示确认,3、开始下载
|
||||
@@ -72,6 +119,7 @@ namespace HotMain.SHGame.Procedure
|
||||
|
||||
//切换到加载热更包入口
|
||||
ChangeState<ProcedureLoadHot>(procedureOwner);
|
||||
|
||||
}
|
||||
|
||||
private int TryGetTagPatchCount(string packageName, string tag)
|
||||
@@ -174,6 +222,7 @@ namespace HotMain.SHGame.Procedure
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void OnDownloadProgressUpdateFunction(int totalCount, int currentCount, long totalBytes, long currentBytes)
|
||||
{
|
||||
EventUtil.DispatchEvent(HotMainEvent.DownloaderProgressUpdate,totalCount,currentCount,totalBytes,currentBytes);
|
||||
Log.Debug($"文件总数:{totalCount}, 已下载文件数:{currentCount}, 下载总大小:{totalBytes}, 已下载大小:{currentBytes}");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.IO;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using YooAsset;
|
||||
|
||||
@@ -86,4 +87,5 @@ namespace HotMain.SHGame.YooAsset
|
||||
return 1024;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
8
JNFrame2/Assets/HotResources/ResLauncher.meta
Normal file
8
JNFrame2/Assets/HotResources/ResLauncher.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 01324e397f8b57046883e895c3c119fe
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
JNFrame2/Assets/HotResources/ResLauncher/FGui.meta
Normal file
8
JNFrame2/Assets/HotResources/ResLauncher/FGui.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 463975de3f691924d8aa4cd3412145eb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2d1c5c9cc28f8ae4d80c7fd3371dda43
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bac7a19729f5a584398ba1619904ade7
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
46
JNFrame2/Assets/HotResources/ResLauncher/HotLauncher.prefab
Normal file
46
JNFrame2/Assets/HotResources/ResLauncher/HotLauncher.prefab
Normal file
@@ -0,0 +1,46 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &5746054680943058182
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6431846330035490337}
|
||||
- component: {fileID: 3619268780635689341}
|
||||
m_Layer: 0
|
||||
m_Name: HotLauncher
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6431846330035490337
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5746054680943058182}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &3619268780635689341
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5746054680943058182}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9a4484ccb149dc24aa373a560079afd7, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c017710233005b499211af4af5a8c04
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
JNFrame2/Assets/HotResources/ResResource.meta
Normal file
8
JNFrame2/Assets/HotResources/ResResource.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41b6813a035e0034e8584e4ddf38a71c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
JNFrame2/Assets/HotResources/ResResource/FGui.meta
Normal file
8
JNFrame2/Assets/HotResources/ResResource/FGui.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c52965636fda385458ae4104ca53b469
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2333f63959faceb4182efe4ad57a7151
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6a963854fc31064588c5ca09caca5d0
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
JNFrame2/Assets/HotScripts/GameLauncher.meta
Normal file
8
JNFrame2/Assets/HotScripts/GameLauncher.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66a61ebb88a94e742a5d74adb5ad268f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
JNFrame2/Assets/HotScripts/GameLauncher/FGui.meta
Normal file
8
JNFrame2/Assets/HotScripts/GameLauncher/FGui.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 382f010898382c74c85229058ab6e520
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
JNFrame2/Assets/HotScripts/GameLauncher/FGui/Build.meta
Normal file
8
JNFrame2/Assets/HotScripts/GameLauncher/FGui/Build.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d51534464e7d0684697d37b78f571c58
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 826cf248984883c4abafb851d9ab209f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,89 @@
|
||||
using FairyGUI;
|
||||
using HotMain;
|
||||
using HotMain.SHGame.Procedure;
|
||||
using Launcher;
|
||||
using SHFrame;
|
||||
using YooAsset;
|
||||
|
||||
namespace HotScripts.GameLauncher.FGui.Scripts
|
||||
{
|
||||
public class LauncherUI : UIBase
|
||||
{
|
||||
|
||||
public UI_Launcher UIView => View as UI_Launcher;
|
||||
private long totalDownloadBytes = 0;
|
||||
|
||||
public override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnOpen(params object[] param)
|
||||
{
|
||||
|
||||
//显示需要升级的大小
|
||||
ResourcePackage rawFilePackage = YooAssets.GetPackage(ProcedureInitializePackage.RawFilePackageName);
|
||||
totalDownloadBytes += rawFilePackage.CreateResourceDownloader(10, 3, 60).TotalDownloadBytes;
|
||||
ResourcePackage defaultPackage = YooAssets.GetPackage(ProcedureInitializePackage.DefaultPackageName);
|
||||
totalDownloadBytes += defaultPackage.CreateResourceDownloader(10, 3, 60).TotalDownloadBytes;
|
||||
|
||||
if (totalDownloadBytes <= 0)
|
||||
{
|
||||
UIView.m_title.text = "资源已经最新";
|
||||
}
|
||||
else
|
||||
{
|
||||
UIView.m_title.text = $"需更新 {totalDownloadBytes} 字节资源";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override void AddListener()
|
||||
{
|
||||
|
||||
UIView.m_downloader.onClick.Add(OnDownloader);
|
||||
|
||||
EventUtil.AddListener(HotMainEvent.DownloaderProgressUpdate,OnDownloaderProgressUpdate);
|
||||
|
||||
}
|
||||
|
||||
public override void RemoveListener()
|
||||
{
|
||||
UIView.m_downloader.onClick.Add(OnDownloader);
|
||||
|
||||
EventUtil.RemoveListener(HotMainEvent.DownloaderProgressUpdate,OnDownloaderProgressUpdate);
|
||||
}
|
||||
|
||||
|
||||
private void OnDownloader(EventContext context)
|
||||
{
|
||||
EventUtil.DispatchEvent(HotMainEvent.StartDownloader);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 资源更新进度
|
||||
/// </summary>
|
||||
private void OnDownloaderProgressUpdate(EventArgs eventargs)
|
||||
{
|
||||
int totalCount = (int)eventargs.args[0];
|
||||
int currentCount = (int)eventargs.args[1];
|
||||
long totalBytes = (long)eventargs.args[2];
|
||||
long currentBytes = (long)eventargs.args[3];
|
||||
|
||||
if (currentBytes <= 0)
|
||||
{
|
||||
UIView.m_progress.value = 0;
|
||||
}else
|
||||
{
|
||||
UIView.m_progress.value = (currentBytes*100) / totalBytes;
|
||||
}
|
||||
UIView.m_title.text = $"文件总数:{totalCount}, 已下载文件数:{currentCount}, 下载总大小:{totalBytes}, 已下载大小:{currentBytes}";
|
||||
}
|
||||
|
||||
public override void OnClose()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f0dc1f485ca487e8a69893724fdd2bd
|
||||
timeCreated: 1729011198
|
||||
20
JNFrame2/Assets/HotScripts/GameLauncher/GameLauncher.asmdef
Normal file
20
JNFrame2/Assets/HotScripts/GameLauncher/GameLauncher.asmdef
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "GameLauncher",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:f4270d81837019d47b93f11421168dae",
|
||||
"GUID:f51ebe6a0ceec4240a699833d6309b23",
|
||||
"GUID:23aed7c57bb0a5d49aeaef92abb5bfff",
|
||||
"GUID:e34a5702dd353724aa315fb8011f08c3",
|
||||
"GUID:00b62574639528e40bdd0ce0d013db67"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b12e2c634b4214e4bab66a9cac501248
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
20
JNFrame2/Assets/HotScripts/GameLauncher/HotLauncherMain.cs
Normal file
20
JNFrame2/Assets/HotScripts/GameLauncher/HotLauncherMain.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using HotScripts.GameLauncher.FGui.Scripts;
|
||||
using Launcher;
|
||||
using SHFrame;
|
||||
using UnityEngine;
|
||||
|
||||
public class HotLauncherMain : MonoBehaviour
|
||||
{
|
||||
private void Start()
|
||||
{
|
||||
//打开下载页
|
||||
RunLauncher().Forget();
|
||||
}
|
||||
|
||||
private async UniTask RunLauncher()
|
||||
{
|
||||
LauncherBinder.BindAll();
|
||||
await SHFrameModule.UI.Open<LauncherUI>("Launcher", "Launcher", UILayerEnum.Root);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a4484ccb149dc24aa373a560079afd7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
JNFrame2/Assets/HotScripts/GameScripts.meta
Normal file
8
JNFrame2/Assets/HotScripts/GameScripts.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a0e886dedded7384784adaae86dd1ddf
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
JNFrame2/Assets/HotScripts/GameScripts/FGui.meta
Normal file
8
JNFrame2/Assets/HotScripts/GameScripts/FGui.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f6f997587afcb840b9139ce8a3ff3b2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
JNFrame2/Assets/HotScripts/GameScripts/FGui/Build.meta
Normal file
8
JNFrame2/Assets/HotScripts/GameScripts/FGui/Build.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f45d335a26535941bd3040692e68b2d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
16
JNFrame2/Assets/HotScripts/GameScripts/GameScripts.asmdef
Normal file
16
JNFrame2/Assets/HotScripts/GameScripts/GameScripts.asmdef
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "GameScripts",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:f4270d81837019d47b93f11421168dae"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 30cdc49ab6f9ba240b6b000711d4e038
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -4,6 +4,6 @@ public class InstantiateByAsset : MonoBehaviour
|
||||
{
|
||||
void Start()
|
||||
{
|
||||
Debug.Log("原始代码3333");
|
||||
Debug.Log("原始代码9999");
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,9 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
|
||||
// {{ AOT assemblies
|
||||
public static readonly IReadOnlyList<string> PatchedAOTAssemblyList = new List<string>
|
||||
{
|
||||
"SHFrame.dll",
|
||||
"UniTask.dll",
|
||||
"mscorlib.dll",
|
||||
};
|
||||
// }}
|
||||
|
||||
@@ -12,9 +15,20 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
|
||||
// }}
|
||||
|
||||
// {{ AOT generic types
|
||||
// Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask.<>c<HotLauncherMain.<RunLauncher>d__1>
|
||||
// Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask<HotLauncherMain.<RunLauncher>d__1>
|
||||
// Cysharp.Threading.Tasks.ITaskPoolNode<object>
|
||||
// Cysharp.Threading.Tasks.UniTaskCompletionSourceCore<Cysharp.Threading.Tasks.AsyncUnit>
|
||||
// System.Action<object>
|
||||
// System.Func<int>
|
||||
// }}
|
||||
|
||||
public void RefMethods()
|
||||
{
|
||||
// System.Void Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskMethodBuilder.AwaitUnsafeOnCompleted<Cysharp.Threading.Tasks.UniTask.Awaiter,HotLauncherMain.<RunLauncher>d__1>(Cysharp.Threading.Tasks.UniTask.Awaiter&,HotLauncherMain.<RunLauncher>d__1&)
|
||||
// System.Void Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskMethodBuilder.Start<HotLauncherMain.<RunLauncher>d__1>(HotLauncherMain.<RunLauncher>d__1&)
|
||||
// System.Void Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskMethodBuilder.Start<SHFrame.UIModule.<Open>d__27<object>>(SHFrame.UIModule.<Open>d__27<object>&)
|
||||
// Cysharp.Threading.Tasks.UniTask SHFrame.UIModule.Open<object>(string,string,SHFrame.UILayerEnum,object[])
|
||||
// object[] System.Array.Empty<object>()
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<linker>
|
||||
<assembly fullname="FairyGUI.Runtime">
|
||||
<type fullname="FairyGUI.EventCallback1" preserve="all" />
|
||||
<type fullname="FairyGUI.EventContext" preserve="all" />
|
||||
<type fullname="FairyGUI.EventListener" preserve="all" />
|
||||
<type fullname="FairyGUI.GButton" preserve="all" />
|
||||
<type fullname="FairyGUI.GComponent" preserve="all" />
|
||||
<type fullname="FairyGUI.GObject" preserve="all" />
|
||||
<type fullname="FairyGUI.GProgressBar" preserve="all" />
|
||||
<type fullname="FairyGUI.GTextField" preserve="all" />
|
||||
<type fullname="FairyGUI.UIObjectFactory" preserve="all" />
|
||||
<type fullname="FairyGUI.UIPackage" preserve="all" />
|
||||
<type fullname="FairyGUI.Utils.XML" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="HotMain">
|
||||
<type fullname="HotMain.HotMainEvent" preserve="all" />
|
||||
<type fullname="HotMain.SHGame.Procedure.ProcedureInitializePackage" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="SHFrame">
|
||||
<type fullname="SHFrame.EventArgs" preserve="all" />
|
||||
<type fullname="SHFrame.EventListener" preserve="all" />
|
||||
<type fullname="SHFrame.EventListener/EventHandler" preserve="all" />
|
||||
<type fullname="SHFrame.EventUtil" preserve="all" />
|
||||
<type fullname="SHFrame.SHFrameModule" preserve="all" />
|
||||
<type fullname="SHFrame.UIBase" preserve="all" />
|
||||
<type fullname="SHFrame.UILayerEnum" preserve="all" />
|
||||
<type fullname="SHFrame.UIModule" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="System">
|
||||
<type fullname="System.CodeDom.Compiler.GeneratedCodeAttribute" preserve="all" />
|
||||
<type fullname="System.ComponentModel.EditorBrowsableAttribute" preserve="all" />
|
||||
<type fullname="System.ComponentModel.EditorBrowsableState" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="UniTask">
|
||||
<type fullname="Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskMethodBuilder" preserve="all" />
|
||||
<type fullname="Cysharp.Threading.Tasks.UniTask" preserve="all" />
|
||||
<type fullname="Cysharp.Threading.Tasks.UniTask/Awaiter" preserve="all" />
|
||||
<type fullname="Cysharp.Threading.Tasks.UniTaskExtensions" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="UnityEngine.CoreModule">
|
||||
<type fullname="UnityEngine.Debug" preserve="all" />
|
||||
<type fullname="UnityEngine.MonoBehaviour" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="YooAsset">
|
||||
<type fullname="YooAsset.DownloaderOperation" preserve="all" />
|
||||
<type fullname="YooAsset.ResourceDownloaderOperation" preserve="all" />
|
||||
<type fullname="YooAsset.ResourcePackage" preserve="all" />
|
||||
<type fullname="YooAsset.YooAssets" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="mscorlib">
|
||||
<type fullname="System.Array" preserve="all" />
|
||||
<type fullname="System.Attribute" preserve="all" />
|
||||
@@ -17,12 +56,21 @@
|
||||
<type fullname="System.Byte" preserve="all" />
|
||||
<type fullname="System.Diagnostics.DebuggableAttribute" preserve="all" />
|
||||
<type fullname="System.Diagnostics.DebuggableAttribute/DebuggingModes" preserve="all" />
|
||||
<type fullname="System.Diagnostics.DebuggerHiddenAttribute" preserve="all" />
|
||||
<type fullname="System.Exception" preserve="all" />
|
||||
<type fullname="System.Int32" preserve="all" />
|
||||
<type fullname="System.Int64" preserve="all" />
|
||||
<type fullname="System.Object" preserve="all" />
|
||||
<type fullname="System.ParamArrayAttribute" preserve="all" />
|
||||
<type fullname="System.Runtime.CompilerServices.AsyncStateMachineAttribute" preserve="all" />
|
||||
<type fullname="System.Runtime.CompilerServices.CompilationRelaxationsAttribute" preserve="all" />
|
||||
<type fullname="System.Runtime.CompilerServices.CompilerGeneratedAttribute" preserve="all" />
|
||||
<type fullname="System.Runtime.CompilerServices.IAsyncStateMachine" preserve="all" />
|
||||
<type fullname="System.Runtime.CompilerServices.RuntimeCompatibilityAttribute" preserve="all" />
|
||||
<type fullname="System.Runtime.CompilerServices.RuntimeHelpers" preserve="all" />
|
||||
<type fullname="System.RuntimeFieldHandle" preserve="all" />
|
||||
<type fullname="System.RuntimeTypeHandle" preserve="all" />
|
||||
<type fullname="System.String" preserve="all" />
|
||||
<type fullname="System.Type" preserve="all" />
|
||||
<type fullname="System.ValueType" preserve="all" />
|
||||
</assembly>
|
||||
|
||||
3
JNFrame2/Assets/Plugins/SHFrame/Runtime/Core/Event.meta
Normal file
3
JNFrame2/Assets/Plugins/SHFrame/Runtime/Core/Event.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1398040438c14d5283657f570b57a31e
|
||||
timeCreated: 1729011976
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace SHFrame
|
||||
{
|
||||
/// <summary> 事件参数
|
||||
/// <para>ZhangYu 2019-03-05</para>
|
||||
/// </summary>
|
||||
public class EventArgs
|
||||
{
|
||||
/// <summary> 事件类型 </summary>
|
||||
public readonly string type;
|
||||
|
||||
/// <summary> 事件参数 </summary>
|
||||
public readonly object[] args;
|
||||
|
||||
public EventArgs(string type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public EventArgs(string type, params object[] args)
|
||||
{
|
||||
this.type = type;
|
||||
this.args = args;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b8bc2c30ad9668644ba298f980f2eda6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,74 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SHFrame
|
||||
{
|
||||
/// <summary>
|
||||
/// 事件派发器
|
||||
/// <para>ZhangYu 2019-03-05</para>
|
||||
/// </summary>
|
||||
public class EventDispatcher
|
||||
{
|
||||
/// <summary> 事件Map </summary>
|
||||
private Dictionary<string, EventListener> dic = new Dictionary<string, EventListener>();
|
||||
|
||||
/// <summary> 添加事件监听器 </summary>
|
||||
/// <param name="eventType">事件类型</param>
|
||||
/// <param name="eventHandler">事件处理器</param>
|
||||
public void AddListener(string eventType, EventListener.EventHandler eventHandler)
|
||||
{
|
||||
EventListener invoker;
|
||||
if (!dic.TryGetValue(eventType, out invoker))
|
||||
{
|
||||
invoker = new EventListener();
|
||||
dic.Add(eventType, invoker);
|
||||
}
|
||||
invoker.eventHandler += eventHandler;
|
||||
}
|
||||
|
||||
/// <summary> 移除事件监听器 </summary>
|
||||
/// <param name="eventType">事件类型</param>
|
||||
/// <param name="eventHandler">事件处理器</param>
|
||||
public void RemoveListener(string eventType, EventListener.EventHandler eventHandler)
|
||||
{
|
||||
EventListener invoker;
|
||||
if (dic.TryGetValue(eventType, out invoker)) invoker.eventHandler -= eventHandler;
|
||||
}
|
||||
|
||||
/// <summary> 是否已经拥有该类型的事件 </summary>
|
||||
/// <param name="eventType">事件类型</param>
|
||||
public bool HasListener(string eventType)
|
||||
{
|
||||
return dic.ContainsKey(eventType);
|
||||
}
|
||||
|
||||
/// <summary> 派发事件 </summary>
|
||||
/// <param name="eventType">事件类型</param>
|
||||
public void DispatchEvent(string eventType, params object[] args)
|
||||
{
|
||||
EventListener invoker;
|
||||
if (dic.TryGetValue(eventType, out invoker))
|
||||
{
|
||||
EventArgs evt;
|
||||
if (args == null || args.Length == 0)
|
||||
{
|
||||
evt = new EventArgs(eventType);
|
||||
}
|
||||
else
|
||||
{
|
||||
evt = new EventArgs(eventType, args);
|
||||
}
|
||||
invoker.Invoke(evt);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> 清理所有事件监听器 </summary>
|
||||
public void Clear()
|
||||
{
|
||||
foreach (EventListener value in dic.Values)
|
||||
{
|
||||
value.Clear();
|
||||
}
|
||||
dic.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1303100c362aa10459237b5ad8617f4b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,27 @@
|
||||
namespace SHFrame
|
||||
{
|
||||
/// <summary>
|
||||
/// 事件监听器
|
||||
/// <para>ZhangYu 2019-03-05</para>
|
||||
/// </summary>
|
||||
public class EventListener
|
||||
{
|
||||
/// <summary> 事件处理器委托 </summary>
|
||||
public delegate void EventHandler(EventArgs eventArgs);
|
||||
|
||||
/// <summary> 事件处理器集合 </summary>
|
||||
public EventHandler eventHandler;
|
||||
|
||||
/// <summary> 调用所有添加的事件 </summary>
|
||||
public void Invoke(EventArgs eventArgs)
|
||||
{
|
||||
if (eventHandler != null) eventHandler.Invoke(eventArgs);
|
||||
}
|
||||
|
||||
/// <summary> 清理所有事件委托 </summary>
|
||||
public void Clear()
|
||||
{
|
||||
eventHandler = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dae197cb1d1228547a2af3254650955a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,53 @@
|
||||
namespace SHFrame
|
||||
{
|
||||
/// <summary>
|
||||
/// 事件工具
|
||||
/// <para>ZhangYu 2019-03-04</para>
|
||||
/// </summary>
|
||||
public static class EventUtil
|
||||
{
|
||||
/// <summary> 事件派发器 </summary>
|
||||
private static EventDispatcher dispatcher = new EventDispatcher();
|
||||
|
||||
/// <summary> 添加事件监听器 </summary>
|
||||
/// <param name="eventType">事件类型</param>
|
||||
/// <param name="eventHandler">事件处理器</param>
|
||||
public static void AddListener(string eventType, EventListener.EventHandler eventHandler)
|
||||
{
|
||||
dispatcher.AddListener(eventType, eventHandler);
|
||||
}
|
||||
|
||||
/// <summary> 移除事件监听器 </summary>
|
||||
/// <param name="eventType">事件类型</param>
|
||||
/// <param name="eventHandler">事件处理器</param>
|
||||
public static void RemoveListener(string eventType, EventListener.EventHandler eventHandler)
|
||||
{
|
||||
dispatcher.RemoveListener(eventType, eventHandler);
|
||||
}
|
||||
|
||||
/// <summary> 是否已经拥有该类型的事件 </summary>
|
||||
/// <param name="eventType">事件类型</param>
|
||||
public static bool HasListener(string eventType)
|
||||
{
|
||||
return dispatcher.HasListener(eventType);
|
||||
}
|
||||
|
||||
/// <summary> 派发事件 </summary>
|
||||
/// <param name="eventType">事件类型</param>
|
||||
public static void DispatchEvent(string eventType, params object[] args)
|
||||
{
|
||||
dispatcher.DispatchEvent(eventType, args);
|
||||
}
|
||||
|
||||
/// <summary> 清理所有事件监听器 </summary>
|
||||
public static void Clear()
|
||||
{
|
||||
dispatcher.Clear();
|
||||
}
|
||||
|
||||
// public static void DispatchEvent(string updateItemOrCard, object updateExpCard)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dd0630485bf39a24fb4fbf8a933447af
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -14,20 +14,29 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
BuildinFiles:
|
||||
- PackageName: DefaultPackage
|
||||
FileName: 6e7621677213f3254dc11b107c126e0a.bundle
|
||||
FileCRC32: 3d3f3578
|
||||
FileName: 23a79bab4ef77e0492f8030793de8daf.bundle
|
||||
FileCRC32: 7dd30a54
|
||||
- PackageName: DefaultPackage
|
||||
FileName: f0f60c08cc10dcb0e6c45442757414a3.bundle
|
||||
FileCRC32: 56c2192b
|
||||
FileName: 2caecd96b8ef866a761e2334613c99a4.bundle
|
||||
FileCRC32: f5bac43b
|
||||
- PackageName: DefaultPackage
|
||||
FileName: af4be7e06874dee64cbb9132b8b1c01a.bundle
|
||||
FileCRC32: 5dc9e586
|
||||
- PackageName: DefaultPackage
|
||||
FileName: b3ef0c36ac5e09335ee19601f3a0cac1.bundle
|
||||
FileCRC32: 24b4d89d
|
||||
- PackageName: RawFilePackage
|
||||
FileName: 3323855830799371855418d404b9d19f.rawfile
|
||||
FileCRC32: 5b90ef0a
|
||||
FileName: 20cb526248ed8fbc2a222e07849f4c64.rawfile
|
||||
FileCRC32: dd111a87
|
||||
- PackageName: RawFilePackage
|
||||
FileName: 3f402809b2ac18568ce38504dca9b93e.rawfile
|
||||
FileCRC32: c9fffdca
|
||||
FileName: 4e1f435ea2f1bfd9b23da97f5b2e2e63.rawfile
|
||||
FileCRC32: d5eb900b
|
||||
- PackageName: RawFilePackage
|
||||
FileName: 570a7c285a3c681be978ebe1bef253e6.rawfile
|
||||
FileCRC32: d8b11dcf
|
||||
FileName: 5bcc366233772218428801b8faddf16b.rawfile
|
||||
FileCRC32: 60d9d574
|
||||
- PackageName: RawFilePackage
|
||||
FileName: 7f16fde6c75d6666fe6c473bc200574a.rawfile
|
||||
FileCRC32: 8fdcce3d
|
||||
FileName: 8d1cddd370f83e6ebd13b6b0ea5479f8.rawfile
|
||||
FileCRC32: 03aa97cf
|
||||
- PackageName: RawFilePackage
|
||||
FileName: 9b0c4e523a9c7b02825b5483d70159b0.rawfile
|
||||
FileCRC32: ab9e96cc
|
||||
|
||||
@@ -1 +1 @@
|
||||
2024-10-15-1037
|
||||
2024-10-16-149
|
||||
@@ -1 +1 @@
|
||||
2024-10-15-1087
|
||||
2024-10-16-167
|
||||
Reference in New Issue
Block a user