This commit is contained in:
2026-10-17 03:01:15 +08:00
parent 1932b8569b
commit c26b86c37a
435 changed files with 4037850 additions and 16884 deletions
@@ -15,7 +15,7 @@ MonoBehaviour:
m_DefaultGroup: a263e71fce79f2f4cb5b5f1fa6b7291a
m_currentHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
Hash: 902baa550336f44ba188a21628caa26a
m_OptimizeCatalogSize: 0
m_BuildRemoteCatalog: 0
m_BundleLocalCatalog: 0
@@ -17,6 +17,11 @@ MonoBehaviour:
m_SerializedData: []
m_GUID: a263e71fce79f2f4cb5b5f1fa6b7291a
m_SerializeEntries:
- m_GUID: 02c4548d2ee59d046afa19dee20d4153
m_Address: XJMH
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 0b865f49bc8ab8647a2952792d8b1f3f
m_Address: Assets/Audios/Default/sound_ui_gow_bgm.ogg
m_ReadOnly: 0
@@ -31,6 +36,11 @@ MonoBehaviour:
- PTCBZS
- ZSYX
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 11e4a8c71622d8c439add11c080ae733
m_Address: HHWK
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 3ff18466016e86542b372582f348d0d6
m_Address: Assets/MyGame/aa/Game/ZhanShen/Game/display_FishEntry_6004.prefab
m_ReadOnly: 0
@@ -78,6 +88,11 @@ MonoBehaviour:
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 873adaea65e45f1459ca61ad4c465029
m_Address: FLZY
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 88507e399a88aa744970855b92a576a8
m_Address: Assets/MyGame/aa/UI/Home/Sub/Turret/ZhanShen.renderTexture
m_ReadOnly: 0
@@ -125,6 +140,11 @@ MonoBehaviour:
- Audio
- Default
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: c7df62a546c0efb43a2604b2917da8a6
m_Address: YYSC
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: ddf39675e15720c4f9713919c1b67d04
m_Address: UIScene
m_ReadOnly: 0
+59 -28
View File
@@ -7,15 +7,25 @@ using UnityEngine;
using UnityEngine.SceneManagement;
/// <summary>
/// 创建纯 AOT 引导场景 BootScene 并配置 Build Settings / Addressables。
/// 引导场景保持全空(不挂任何组件),规避 HybridCLR "热更脚本不能挂在随主包场景上" 的限制。
/// 启动流程:BootScene(空)→ Launcher 加载热更 dll → 通过 Addressables 加载 UIScene。
/// 场景加载方式配置工具(HybridCLR 配套):
///
/// 规则:**凡是挂了热更脚本(Game.Hotfix)的场景,都不能随主包(Build Settings)加载**,
/// 必须通过 AssetBundle/Addressables 加载,否则运行时会变成 missing script
/// (典型现象:场景里的 MonoBehaviour 不工作,比如背景不动、UI 不响应)。
/// - UIScene:挂了 GameManager/TiShi/LoadingPanel/HuoDe 等 → 走 Addressables
/// - XJMH/FLZY/HHWK/YYSC:挂了 BGManager/BgFit 等 → 走 Addressables
/// - BootScene:纯 AOT 空场景(唯一随主包的场景),只负责启动
/// </summary>
public static class BootSceneCreator
{
private const string BootScenePath = "Assets/MyGame/Scenes/BootScene.unity";
private const string UIScenePath = "Assets/MyGame/Scenes/UIScene.unity";
/// <summary>游戏场景(内部挂热更脚本,必须走 Addressables 加载)</summary>
private static readonly string[] GameSceneNames = { "XJMH", "FLZY", "HHWK", "YYSC" };
private static string GameScenePath(string name) => $"Assets/MyGame/Scenes/{name}.unity";
[MenuItem("Tools/Create BootScene")]
public static void CreateBootScene()
{
@@ -36,44 +46,66 @@ public static class BootSceneCreator
Debug.Log($"[BootSceneCreator] 引导场景已创建: {BootScenePath}");
// 3. 更新 Build Settings:
// - BootScene 设为第一个(启动场景)
// - UIScene 从 Build Settings 移除(改为通过 Addressables 加载)
// - 其他场景保留
UpdateBuildSettings();
// 3. 把需要走 Addressables 的场景都标记好、并统一整理 Build Settings
SetupGameScenesToAddressablesInternal();
MarkSceneAddressable(UIScenePath, "UIScene");
// 4. 把 UIScene 标记为 Addressable(key = "UIScene"),Launcher 会按这个 key 加载
MarkUISceneAddressable();
// 5. 打开引导场景
// 4. 打开引导场景
EditorSceneManager.OpenScene(BootScenePath);
Debug.Log("[BootSceneCreator] 完成!请运行 HybridCLR > Generate > All 并重新构建。");
}
private static void UpdateBuildSettings()
/// <summary>
/// 把游戏场景(XJMH/FLZY/HHWK/YYSC)标记为 Addressable(address = 场景名),
/// 并把它们从 Build Settings 移除(改由 Addressables 加载)。
/// </summary>
[MenuItem("Tools/Setup Game Scenes To Addressables")]
public static void SetupGameScenesToAddressables()
{
SetupGameScenesToAddressablesInternal();
Debug.Log("[BootSceneCreator] 游戏场景已标记为 Addressable(address = 场景名)并从 Build Settings 移除。请重新构建。");
}
private static void SetupGameScenesToAddressablesInternal()
{
foreach (var name in GameSceneNames)
MarkSceneAddressable(GameScenePath(name), name);
ApplyBuildSettings();
AssetDatabase.SaveAssets();
}
/// <summary>
/// 统一整理 Build Settings:
/// - BootScene 放第一位(启动场景)
/// - UIScene 与 4 个游戏场景全部移除(它们都改走 Addressables 加载)
/// </summary>
private static void ApplyBuildSettings()
{
var scenes = new List<EditorBuildSettingsScene>(EditorBuildSettings.scenes);
// 移除已存在的 BootScene(防重复)
// 先移除所有需要走 Addressables 的场景,避免重复
scenes.RemoveAll(s => s.path == BootScenePath);
scenes.RemoveAll(s => s.path == UIScenePath);
foreach (var name in GameSceneNames)
{
string path = GameScenePath(name);
scenes.RemoveAll(s => s.path == path);
}
// BootScene 插到最前面
scenes.Insert(0, new EditorBuildSettingsScene(BootScenePath, true));
// 移除 UIScene(现在由 Addressables 加载,不再随主包)
scenes.RemoveAll(s => s.path == UIScenePath);
EditorBuildSettings.scenes = scenes.ToArray();
Debug.Log("[BootSceneCreator] Build Settings 已更新:BootScene 为启动场景,UIScene 已移除(改走 Addressables)。");
Debug.Log("[BootSceneCreator] Build Settings 已更新:BootScene 为启动场景,UIScene/XJMH/FLZY/HHWK/YYSC 已移除(改走 Addressables)。");
}
/// <summary>
/// 把 UIScene 标记为 Addressable,address key 设为 "UIScene"。
/// Launcher 会按这个 key 通过 Addressables 加载主场景。
/// 把一个场景标记为 Addressable,address key 设为指定值(Launcher / 游戏内加载按这个 key 找)。
/// </summary>
private static void MarkUISceneAddressable()
private static void MarkSceneAddressable(string scenePath, string key)
{
var settings = AddressableAssetSettingsDefaultObject.Settings;
if (settings == null)
@@ -82,10 +114,10 @@ public static class BootSceneCreator
return;
}
string uiSceneGuid = AssetDatabase.AssetPathToGUID(UIScenePath);
if (string.IsNullOrEmpty(uiSceneGuid))
string guid = AssetDatabase.AssetPathToGUID(scenePath);
if (string.IsNullOrEmpty(guid))
{
Debug.LogError($"[BootSceneCreator] 找不到 UIScene: {UIScenePath}");
Debug.LogError($"[BootSceneCreator] 找不到场景: {scenePath}");
return;
}
@@ -97,12 +129,11 @@ public static class BootSceneCreator
return;
}
AddressableAssetEntry entry = settings.CreateOrMoveEntry(uiSceneGuid, group);
entry.address = "UIScene";
AddressableAssetEntry entry = settings.CreateOrMoveEntry(guid, group);
entry.address = key;
EditorUtility.SetDirty(settings);
AssetDatabase.SaveAssets();
Debug.Log($"[BootSceneCreator] UIScene 已标记为 Addressable,key='UIScene',组='{group.Name}'。");
Debug.Log($"[BootSceneCreator] 场景已标记为 Addressable: {scenePath}(address='{key}',组='{group.Name}')。");
}
}
@@ -25,6 +25,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// {{ AOT generic types
// DG.Tweening.Core.DOGetter<float>
// DG.Tweening.Core.DOSetter<float>
// DelegateList<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>>
// DelegateList<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<long>>
// DelegateList<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<object>>
// DelegateList<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle>
@@ -45,6 +46,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Action<System.ValueTuple<object,object>>
// System.Action<UnityEngine.EventSystems.RaycastResult>
// System.Action<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle,object>
// System.Action<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>>
// System.Action<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<long>>
// System.Action<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<object>>
// System.Action<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle>
@@ -114,6 +116,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Collections.Generic.Dictionary.Enumerator<int,int>
// System.Collections.Generic.Dictionary.Enumerator<int,object>
// System.Collections.Generic.Dictionary.Enumerator<object,UnityEngine.Color>
// System.Collections.Generic.Dictionary.Enumerator<object,UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>>
// System.Collections.Generic.Dictionary.Enumerator<object,UnityEngine.Vector3>
// System.Collections.Generic.Dictionary.Enumerator<object,byte>
// System.Collections.Generic.Dictionary.Enumerator<object,double>
@@ -129,6 +132,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Collections.Generic.Dictionary.KeyCollection.Enumerator<int,int>
// System.Collections.Generic.Dictionary.KeyCollection.Enumerator<int,object>
// System.Collections.Generic.Dictionary.KeyCollection.Enumerator<object,UnityEngine.Color>
// System.Collections.Generic.Dictionary.KeyCollection.Enumerator<object,UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>>
// System.Collections.Generic.Dictionary.KeyCollection.Enumerator<object,UnityEngine.Vector3>
// System.Collections.Generic.Dictionary.KeyCollection.Enumerator<object,byte>
// System.Collections.Generic.Dictionary.KeyCollection.Enumerator<object,double>
@@ -144,6 +148,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Collections.Generic.Dictionary.KeyCollection<int,int>
// System.Collections.Generic.Dictionary.KeyCollection<int,object>
// System.Collections.Generic.Dictionary.KeyCollection<object,UnityEngine.Color>
// System.Collections.Generic.Dictionary.KeyCollection<object,UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>>
// System.Collections.Generic.Dictionary.KeyCollection<object,UnityEngine.Vector3>
// System.Collections.Generic.Dictionary.KeyCollection<object,byte>
// System.Collections.Generic.Dictionary.KeyCollection<object,double>
@@ -159,6 +164,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Collections.Generic.Dictionary.ValueCollection.Enumerator<int,int>
// System.Collections.Generic.Dictionary.ValueCollection.Enumerator<int,object>
// System.Collections.Generic.Dictionary.ValueCollection.Enumerator<object,UnityEngine.Color>
// System.Collections.Generic.Dictionary.ValueCollection.Enumerator<object,UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>>
// System.Collections.Generic.Dictionary.ValueCollection.Enumerator<object,UnityEngine.Vector3>
// System.Collections.Generic.Dictionary.ValueCollection.Enumerator<object,byte>
// System.Collections.Generic.Dictionary.ValueCollection.Enumerator<object,double>
@@ -174,6 +180,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Collections.Generic.Dictionary.ValueCollection<int,int>
// System.Collections.Generic.Dictionary.ValueCollection<int,object>
// System.Collections.Generic.Dictionary.ValueCollection<object,UnityEngine.Color>
// System.Collections.Generic.Dictionary.ValueCollection<object,UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>>
// System.Collections.Generic.Dictionary.ValueCollection<object,UnityEngine.Vector3>
// System.Collections.Generic.Dictionary.ValueCollection<object,byte>
// System.Collections.Generic.Dictionary.ValueCollection<object,double>
@@ -189,6 +196,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Collections.Generic.Dictionary<int,int>
// System.Collections.Generic.Dictionary<int,object>
// System.Collections.Generic.Dictionary<object,UnityEngine.Color>
// System.Collections.Generic.Dictionary<object,UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>>
// System.Collections.Generic.Dictionary<object,UnityEngine.Vector3>
// System.Collections.Generic.Dictionary<object,byte>
// System.Collections.Generic.Dictionary<object,double>
@@ -198,6 +206,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Collections.Generic.EqualityComparer<GameMainPanel_XJMH.HelpTuJianEntry>
// System.Collections.Generic.EqualityComparer<System.ValueTuple<int,int>>
// System.Collections.Generic.EqualityComparer<UnityEngine.Color>
// System.Collections.Generic.EqualityComparer<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>>
// System.Collections.Generic.EqualityComparer<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<object>>
// System.Collections.Generic.EqualityComparer<UnityEngine.Vector3>
// System.Collections.Generic.EqualityComparer<byte>
@@ -223,6 +232,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<int,int>>
// System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<int,object>>
// System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<object,UnityEngine.Color>>
// System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<object,UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>>>
// System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<object,UnityEngine.Vector3>>
// System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<object,byte>>
// System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<object,double>>
@@ -275,6 +285,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<int,int>>
// System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<int,object>>
// System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<object,UnityEngine.Color>>
// System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<object,UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>>>
// System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<object,UnityEngine.Vector3>>
// System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<object,byte>>
// System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<object,double>>
@@ -309,6 +320,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<int,int>>
// System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<int,object>>
// System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<object,UnityEngine.Color>>
// System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<object,UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>>>
// System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<object,UnityEngine.Vector3>>
// System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<object,byte>>
// System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<object,double>>
@@ -363,6 +375,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Collections.Generic.KeyValuePair<int,int>
// System.Collections.Generic.KeyValuePair<int,object>
// System.Collections.Generic.KeyValuePair<object,UnityEngine.Color>
// System.Collections.Generic.KeyValuePair<object,UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>>
// System.Collections.Generic.KeyValuePair<object,UnityEngine.Vector3>
// System.Collections.Generic.KeyValuePair<object,byte>
// System.Collections.Generic.KeyValuePair<object,double>
@@ -433,6 +446,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Collections.Generic.ObjectEqualityComparer<GameMainPanel_XJMH.HelpTuJianEntry>
// System.Collections.Generic.ObjectEqualityComparer<System.ValueTuple<int,int>>
// System.Collections.Generic.ObjectEqualityComparer<UnityEngine.Color>
// System.Collections.Generic.ObjectEqualityComparer<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>>
// System.Collections.Generic.ObjectEqualityComparer<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<object>>
// System.Collections.Generic.ObjectEqualityComparer<UnityEngine.Vector3>
// System.Collections.Generic.ObjectEqualityComparer<byte>
@@ -486,6 +500,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Func<System.ValueTuple<object,object>,byte>
// System.Func<System.ValueTuple<object,object>,object>
// System.Func<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle,UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<object>>
// System.Func<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>
// System.Func<byte,object>
// System.Func<byte>
// System.Func<double,byte>
@@ -495,6 +510,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Func<int,object>
// System.Func<long>
// System.Func<object,System.Threading.Tasks.VoidTaskResult>
// System.Func<object,UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>
// System.Func<object,byte>
// System.Func<object,double>
// System.Func<object,int>
@@ -564,35 +580,43 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// System.Runtime.CompilerServices.AsyncTaskMethodBuilder<byte>
// System.Runtime.CompilerServices.AsyncTaskMethodBuilder<object>
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter<System.Threading.Tasks.VoidTaskResult>
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter<byte>
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter<long>
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter<object>
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable<System.Threading.Tasks.VoidTaskResult>
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable<byte>
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable<long>
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable<object>
// System.Runtime.CompilerServices.TaskAwaiter<System.Threading.Tasks.VoidTaskResult>
// System.Runtime.CompilerServices.TaskAwaiter<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>
// System.Runtime.CompilerServices.TaskAwaiter<byte>
// System.Runtime.CompilerServices.TaskAwaiter<long>
// System.Runtime.CompilerServices.TaskAwaiter<object>
// System.Span<float>
// System.Span<int>
// System.Threading.Tasks.ContinuationTaskFromResultTask<System.Threading.Tasks.VoidTaskResult>
// System.Threading.Tasks.ContinuationTaskFromResultTask<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>
// System.Threading.Tasks.ContinuationTaskFromResultTask<byte>
// System.Threading.Tasks.ContinuationTaskFromResultTask<long>
// System.Threading.Tasks.ContinuationTaskFromResultTask<object>
// System.Threading.Tasks.Task<System.Threading.Tasks.VoidTaskResult>
// System.Threading.Tasks.Task<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>
// System.Threading.Tasks.Task<byte>
// System.Threading.Tasks.Task<long>
// System.Threading.Tasks.Task<object>
// System.Threading.Tasks.TaskCompletionSource<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>
// System.Threading.Tasks.TaskCompletionSource<byte>
// System.Threading.Tasks.TaskCompletionSource<long>
// System.Threading.Tasks.TaskCompletionSource<object>
// System.Threading.Tasks.TaskFactory.<>c__DisplayClass35_0<System.Threading.Tasks.VoidTaskResult>
// System.Threading.Tasks.TaskFactory.<>c__DisplayClass35_0<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>
// System.Threading.Tasks.TaskFactory.<>c__DisplayClass35_0<byte>
// System.Threading.Tasks.TaskFactory.<>c__DisplayClass35_0<long>
// System.Threading.Tasks.TaskFactory.<>c__DisplayClass35_0<object>
// System.Threading.Tasks.TaskFactory<System.Threading.Tasks.VoidTaskResult>
// System.Threading.Tasks.TaskFactory<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>
// System.Threading.Tasks.TaskFactory<byte>
// System.Threading.Tasks.TaskFactory<long>
// System.Threading.Tasks.TaskFactory<object>
@@ -634,14 +658,19 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour
// UnityEngine.InputSystem.InputControl<UnityEngine.Vector2>
// UnityEngine.InputSystem.InputProcessor<UnityEngine.Vector2>
// UnityEngine.InputSystem.Utilities.InlinedArray<object>
// UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase.<>c__DisplayClass60_0<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>
// UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase.<>c__DisplayClass60_0<long>
// UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase.<>c__DisplayClass60_0<object>
// UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase.<>c__DisplayClass61_0<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>
// UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase.<>c__DisplayClass61_0<long>
// UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase.<>c__DisplayClass61_0<object>
// UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>
// UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase<long>
// UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase<object>
// UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle.<>c<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>
// UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle.<>c<long>
// UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle.<>c<object>
// UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>
// UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<long>
// UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<object>
// UnityEngine.ResourceManagement.ChainOperationTypelessDepedency<object>
+1
View File
@@ -109,6 +109,7 @@
<type fullname="UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationStatus" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceLocations.IResourceLocation" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneInstance" preserve="all" />
</assembly>
<assembly fullname="Unity.TextMeshPro">
<type fullname="TMPro.FontStyles" preserve="all" />
+1 -1
View File
@@ -583,7 +583,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 22400762, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchoredPosition.y
value: -0.0000076293945
value: 0.000049591064
objectReference: {fileID: 0}
- target: {fileID: 22426080, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchorMax.x
@@ -8,6 +8,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.SceneManagement;
namespace Assets.MyGame.Scripts.Net
@@ -17,6 +20,15 @@ namespace Assets.MyGame.Scripts.Net
/// <summary>已加载(或正在加载)的游戏场景名集合,防止人机 RoomJoinNotice 触发重复 LoadSceneAsync</summary>
private static readonly HashSet<string> _loadedGameScenes = new HashSet<string>();
/// <summary>
/// 游戏场景的 Addressables 加载句柄。
/// 游戏场景(XJMH/FLZY/HHWK/YYSC)里挂的是热更脚本(BGManager/BgFit 等),
/// HybridCLR 要求热更脚本所在场景必须通过 AB/AA 加载,否则运行时会变成 missing script。
/// 卸载时也必须用这个句柄释放,不能只调 SceneManager.UnloadSceneAsync(否则 ab 包会泄漏)。
/// </summary>
private static readonly Dictionary<string, AsyncOperationHandle<SceneInstance>> _gameSceneHandles
= new Dictionary<string, AsyncOperationHandle<SceneInstance>>();
/// <summary>清除指定场景的加载标记(退出游戏时调用,下次进入可重新加载)</summary>
public static void ClearLoadedGameScene(string sceneName)
{
@@ -125,8 +137,7 @@ namespace Assets.MyGame.Scripts.Net
var s = SceneManager.GetSceneByName(sn);
if (s.IsValid() && s.isLoaded)
{
SceneManager.UnloadSceneAsync(sn);
_loadedGameScenes.Remove(sn);
UnloadGameScene(sn);
}
}
@@ -187,8 +198,19 @@ namespace Assets.MyGame.Scripts.Net
var targetScene = SceneManager.GetSceneByName(sceneName);
if (!targetScene.IsValid() || !targetScene.isLoaded)
{
var op = SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Additive);
while (op != null && !op.isDone) yield return null;
// ⭐ 必须通过 Addressables 加载:场景里挂的是热更脚本(Game.Hotfix 里的 BGManager/BgFit 等),
// 如果走 Build Settings(随主包)加载,热更脚本会解析失败变成 missing script —— 背景就会不动。
var handle = Addressables.LoadSceneAsync(sceneName, LoadSceneMode.Additive);
_gameSceneHandles[sceneName] = handle;
while (!handle.IsDone) yield return null;
if (handle.Status != AsyncOperationStatus.Succeeded)
{
Debug.LogError($"[GameScene] Addressables 加载场景失败: {sceneName} → {handle.OperationException}。" +
$"请确认已在 Addressables 里把该场景标记为可寻址,且 address = \"{sceneName}\"。");
_loadedGameScenes.Remove(sceneName);
_gameSceneHandles.Remove(sceneName);
}
}
}
@@ -197,6 +219,26 @@ namespace Assets.MyGame.Scripts.Net
fishPanel.BeginLoadResources();
}
/// <summary>
/// 卸载一个已加载的游戏场景。
/// 如果该场景是通过 Addressables 加载的,必须用句柄释放(否则 ab 包会一直驻留);
/// 没有句柄时退回 SceneManager 卸载,兼容历史上用 SceneManager 加载的场景。
/// </summary>
public static void UnloadGameScene(string sceneName)
{
if (_gameSceneHandles.TryGetValue(sceneName, out var handle))
{
if (handle.IsValid())
Addressables.UnloadSceneAsync(handle, true);
_gameSceneHandles.Remove(sceneName);
}
else
{
SceneManager.UnloadSceneAsync(sceneName);
}
_loadedGameScenes.Remove(sceneName);
}
/// <summary>
/// 把 RoomJoinNotice 玩家数据写入 currRoomData.players(存在则更新,不存在则添加)。
/// JoinGame 里 SetUserInfo 按 userId 从 currRoomData.players 查显示信息
+14 -1
View File
@@ -31,6 +31,7 @@ public class BGManager : MonoBehaviour
private float marginWorld; // 底部余量(世界单位,整像素对齐)
private float offset; // 累计滚动距离
private bool layoutReady;
private bool camWarned;
private readonly List<Transform> tiles = new List<Transform>();
private readonly List<float> pivotToBottom = new List<float>(); // pivot 到底边的世界距离
private readonly List<float> pivotToLeft = new List<float>(); // pivot 到左边的世界距离
@@ -89,7 +90,19 @@ public class BGManager : MonoBehaviour
if (!layoutReady || spacing <= 0f) return;
Camera cam = Camera.main;
if (cam == null) return;
if (cam == null)
{
// ⚠ 静默失效点:拿不到主相机时这里直接 return(offset 还没累加),表现就是“背景在、但不动”。
// 本场景自己没有相机,完全依赖别的场景里被标成 MainCamera 的相机;相机被换掉/禁用就会走到这里。
// 打一次日志,避免这种问题被误判成“脚本坏了”。
if (!camWarned)
{
camWarned = true;
Debug.LogError("[BGManager] 拿不到 Camera.main(当前没有已启用且 Tag=MainCamera 的相机),背景不会滚动!");
}
return;
}
camWarned = false;
offset += speed * Time.deltaTime;
@@ -350,6 +350,8 @@ GameObject:
- component: {fileID: 2009079403180933285}
- component: {fileID: 4954842465562911275}
- component: {fileID: 7163620323263908890}
- component: {fileID: 5377554431217739385}
- component: {fileID: 2451405837072168603}
m_Layer: 5
m_Name: "\u606D\u559C\u83B7\u5F97"
m_TagString: Untagged
@@ -478,6 +480,46 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!223 &5377554431217739385
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2690998977450096951}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 2
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 1
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 0
m_AdditionalShaderChannelsFlag: 0
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0
m_SortingOrder: 201
m_TargetDisplay: 0
--- !u!114 &2451405837072168603
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2690998977450096951}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!1 &3332973739330408075
GameObject:
m_ObjectHideFlags: 0
@@ -823,10 +823,12 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
if (_changeRoomBar == null)
{
UnLoadResources();
// 场景可能未加载或已卸载,做保护避免重复卸载报错
// 场景可能未加载或已卸载,做保护避免重复卸载报错。
// ⭐ 统一走 WebSocketReponseList.UnloadGameScene:场景是用 Addressables 加载的,
// 必须用 ab 句柄释放,只调 SceneManager.UnloadSceneAsync 会漏掉 ab 包。
var scene = SceneManager.GetSceneByName(sceneName);
if (scene.IsValid() && scene.isLoaded)
SceneManager.UnloadSceneAsync(sceneName);
Assets.MyGame.Scripts.Net.WebSocketReponseList.UnloadGameScene(sceneName);
// 清除场景加载标记,下次进入可重新加载
Assets.MyGame.Scripts.Net.WebSocketReponseList.ClearLoadedGameScene(sceneName);
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f3b3361c4a3cc3c429bbc1af45a96060
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cf9902169e143b54d9e37c8364f4986b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 06b6699f783747445ae6a6ad233d3725
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,285 @@
using System.Collections.Generic;
using System.Text;
using TMPro;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// ChouJiangItem 批量绑定工具(编辑器专用)。
/// 把预制体拖进窗口(或 Project 里选中预制体/文件夹后点「从当前选中添加」),再点「开始绑定」:
/// 工具会找出所有名字以 ItemGrid 开头的格子,给每个格子挂上 ChouJiangItem,并按子物体名自动赋值:
///
/// Item → img_Icon(该节点上的 Image 组件)
/// Label → tmp_Count(该节点上是 TMP 时)/ tmp_Count_Old(该节点上是 UGUI Text 时)
/// 道具名字节点 → tmp_Name / tmp_Name_Old(节点名在窗口里配,留空则不处理)
/// GridMask → obj_Drawn
/// eff_xuan → obj_Selecting
/// eff_xuanzhong → obj_Landed
///
/// 节点名先在**直接子物体**里精确匹配(ItemGrid 下还有同名的 GridMask 子节点,
/// 所以必须优先取直接子物体),找不到再退到子树里找第一个同名节点。
/// itemId 不动,交给 ChouJiangToggle 按列表顺序自动编号。
/// </summary>
public class ChouJiangItemBinder : EditorWindow
{
const string CellPrefix = "ItemGrid"; // 格子节点名前缀
const string NodeIcon = "Item"; // 奖品图片
const string NodeLabel = "Label"; // 数量文本
const string NodeDrawn = "GridMask"; // 已抽中遮罩
const string NodeSelecting = "eff_xuan"; // 选中高亮
const string NodeLanded = "eff_xuanzhong"; // 抽中停留
[SerializeField] List<GameObject> targets = new List<GameObject>();
[SerializeField] string nameNode = ""; // 道具名字节点名,留空=不处理
[SerializeField] bool keepExisting = false; // 已有引用不覆盖
Vector2 scroll;
[MenuItem("Tools/抽奖/批量绑定 ChouJiangItem")]
static void Open()
{
ChouJiangItemBinder w = GetWindow<ChouJiangItemBinder>("抽奖 Item 绑定");
w.minSize = new Vector2(440f, 360f);
}
void OnGUI()
{
EditorGUILayout.LabelField("把预制体拖进来(或 Project 里选中后点下面的按钮)", EditorStyles.boldLabel);
Rect dropArea = GUILayoutUtility.GetRect(0f, 46f, GUILayout.ExpandWidth(true));
GUI.Box(dropArea, "拖预制体 / 文件夹到这里");
HandleDrag(dropArea);
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("从当前选中添加")) AddFromSelection();
if (GUILayout.Button("清空列表")) targets.Clear();
EditorGUILayout.EndHorizontal();
EditorGUILayout.Space();
nameNode = EditorGUILayout.TextField("道具名字节点名(留空=不处理)", nameNode);
keepExisting = EditorGUILayout.Toggle("保留已有引用(不覆盖)", keepExisting);
EditorGUILayout.LabelField($"待绑定预制体:{targets.Count} 个");
scroll = EditorGUILayout.BeginScrollView(scroll, GUILayout.Height(110f));
for (int i = targets.Count - 1; i >= 0; i--)
{
EditorGUILayout.BeginHorizontal();
targets[i] = (GameObject)EditorGUILayout.ObjectField(targets[i], typeof(GameObject), false);
if (GUILayout.Button("×", GUILayout.Width(24f))) targets.RemoveAt(i);
EditorGUILayout.EndHorizontal();
}
EditorGUILayout.EndScrollView();
EditorGUILayout.Space();
using (new EditorGUI.DisabledScope(targets.Count == 0))
{
if (GUILayout.Button("开始绑定", GUILayout.Height(30f))) Run();
}
}
// ---------------- 目标收集 ----------------
void HandleDrag(Rect area)
{
Event e = Event.current;
if (e == null || !area.Contains(e.mousePosition)) return;
if (e.type != EventType.DragUpdated && e.type != EventType.DragPerform) return;
DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
if (e.type == EventType.DragPerform)
{
DragAndDrop.AcceptDrag();
foreach (Object o in DragAndDrop.objectReferences) AddTarget(o);
e.Use();
}
}
void AddFromSelection()
{
int before = targets.Count;
foreach (Object o in Selection.objects) AddTarget(o);
if (targets.Count == before) Debug.LogWarning("[抽奖绑定] 当前选中里没有预制体或含预制体的文件夹");
}
void AddTarget(Object o)
{
// 文件夹:递归收集里面的预制体
string path = AssetDatabase.GetAssetPath(o);
if (!string.IsNullOrEmpty(path) && AssetDatabase.IsValidFolder(path))
{
string[] guids = AssetDatabase.FindAssets("t:Prefab", new[] { path });
foreach (string g in guids) AddTarget(AssetDatabase.LoadAssetAtPath<GameObject>(AssetDatabase.GUIDToAssetPath(g)));
return;
}
GameObject go = o as GameObject;
if (go == null)
{
Debug.LogWarning("[抽奖绑定] 只支持预制体(GameObject),已跳过:" + o);
return;
}
if (string.IsNullOrEmpty(path) || !path.EndsWith(".prefab"))
{
Debug.LogWarning("[抽奖绑定] 不是预制体文件,已跳过:" + go.name);
return;
}
if (!targets.Contains(go)) targets.Add(go);
}
// ---------------- 执行绑定 ----------------
void Run()
{
List<string> paths = new List<string>();
foreach (GameObject go in targets)
{
string p = AssetDatabase.GetAssetPath(go);
if (!string.IsNullOrEmpty(p) && !paths.Contains(p)) paths.Add(p);
}
StringBuilder sb = new StringBuilder();
int cellAll = 0, missAll = 0;
for (int i = 0; i < paths.Count; i++)
{
string path = paths[i];
EditorUtility.DisplayProgressBar("绑定 ChouJiangItem", path, (float)i / paths.Count);
try
{
int cells, miss;
BindOne(path, out cells, out miss);
cellAll += cells;
missAll += miss;
sb.AppendLine($"{System.IO.Path.GetFileName(path)}:格子 {cells} 个" +
(miss > 0 ? $",{miss} 个有缺失节点(见 Console 警告)" : ",全部绑定完成"));
}
catch (System.Exception ex)
{
sb.AppendLine($"{System.IO.Path.GetFileName(path)}:失败 {ex.Message}");
Debug.LogError($"[抽奖绑定] {path} 处理失败:{ex}");
}
}
EditorUtility.ClearProgressBar();
targets.Clear();
Debug.Log($"[抽奖绑定] 完成,共 {cellAll} 个格子,{missAll} 个有缺失节点\n{sb}");
}
void BindOne(string path, out int cellCount, out int missingCount)
{
cellCount = 0;
missingCount = 0;
GameObject root = PrefabUtility.LoadPrefabContents(path);
try
{
Transform[] all = root.GetComponentsInChildren<Transform>(true);
for (int i = 0; i < all.Length; i++)
{
Transform t = all[i];
if (!t.name.StartsWith(CellPrefix)) continue;
// 防止把同名前缀的容器误当格子:必须带 Item 或 GridMask 直接子物体
if (t.Find(NodeIcon) == null && t.Find(NodeDrawn) == null) continue;
cellCount++;
ChouJiangItem item = t.GetComponent<ChouJiangItem>();
if (item == null) item = t.gameObject.AddComponent<ChouJiangItem>();
int missing = 0;
// 奖品图片
Image icon = FindComp<Image>(t, NodeIcon);
if (icon != null) { if (!keepExisting || item.img_Icon == null) item.img_Icon = icon; }
else missing++;
// 数量文本:TMP 优先,没有 TMP 再用 UGUI Text(两版互斥)
Transform label = FindNode(t, NodeLabel);
TextMeshProUGUI tmp = label != null ? label.GetComponent<TextMeshProUGUI>() : null;
Text txt = label != null ? label.GetComponent<Text>() : null;
if (tmp != null)
{
if (!keepExisting || item.tmp_Count == null) { item.tmp_Count = tmp; item.tmp_Count_Old = null; }
}
else if (txt != null)
{
if (!keepExisting || item.tmp_Count_Old == null) { item.tmp_Count_Old = txt; item.tmp_Count = null; }
}
else missing++;
// 道具名字(节点名可配,留空不处理)
if (!string.IsNullOrEmpty(nameNode))
{
Transform nameT = FindNode(t, nameNode);
TextMeshProUGUI nameTmp = nameT != null ? nameT.GetComponent<TextMeshProUGUI>() : null;
Text nameTxt = nameT != null ? nameT.GetComponent<Text>() : null;
if (nameTmp != null)
{
if (!keepExisting || item.tmp_Name == null) { item.tmp_Name = nameTmp; item.tmp_Name_Old = null; }
}
else if (nameTxt != null)
{
if (!keepExisting || item.tmp_Name_Old == null) { item.tmp_Name_Old = nameTxt; item.tmp_Name = null; }
}
}
// 三个状态 GameObject
Transform drawn = FindNode(t, NodeDrawn);
if (drawn != null) { if (!keepExisting || item.obj_Drawn == null) item.obj_Drawn = drawn.gameObject; }
else missing++;
Transform selecting = FindNode(t, NodeSelecting);
if (selecting != null) { if (!keepExisting || item.obj_Selecting == null) item.obj_Selecting = selecting.gameObject; }
else missing++;
Transform landed = FindNode(t, NodeLanded);
if (landed != null) { if (!keepExisting || item.obj_Landed == null) item.obj_Landed = landed.gameObject; }
else missing++;
if (missing > 0)
{
missingCount++;
Debug.LogWarning($"[抽奖绑定] {System.IO.Path.GetFileName(path)} → 格子 {t.name} 缺 {missing} 个节点" +
"(Item / Label / GridMask / eff_xuan / eff_xuanzhong)");
}
}
if (cellCount == 0)
{
Debug.LogWarning($"[抽奖绑定] {path} 里没找到名字以 {CellPrefix} 开头、且带 Item 或 GridMask 的格子");
}
else
{
PrefabUtility.SaveAsPrefabAsset(root, path);
}
}
finally
{
PrefabUtility.UnloadPrefabContents(root);
}
}
// ---------------- 查找 ----------------
/// <summary>先找直接子物体(精确同名),找不到再在整个子树里找第一个同名节点</summary>
static Transform FindNode(Transform cell, string name)
{
Transform direct = cell.Find(name);
if (direct != null) return direct;
Transform[] all = cell.GetComponentsInChildren<Transform>(true);
for (int i = 0; i < all.Length; i++)
{
if (all[i] != cell && all[i].name == name) return all[i];
}
return null;
}
static T FindComp<T>(Transform cell, string name) where T : Component
{
Transform n = FindNode(cell, name);
return n != null ? n.GetComponent<T>() : null;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2c7eb0452470ed54ca72730328199fbb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f85cab18eda75c243ba115fb7ab15245
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6c8e7b245682f9c4894723b20270e564
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,222 @@
using Assets.Framework.Tool;
using Assets.MyGame.Scripts.Net;
using Assets.MyGame.Scripts.Net.API.GameConfig_SubClass;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 抽奖 item 层(第三层):挂在 toggle 层里的每个奖品格子上,
/// 记录道具信息以及奖励的详细信息(prize:类型/数量/权重/库存/道具 product 等)。
///
/// 显示控件全部在 Inspector 里拖,留空就不处理(不报错、不生成任何东西):
/// img_Icon 奖品图片控件:代码把金币/钻石/下载的图标换到这张图上
/// tmp_Count 数量文本(新版·TextMeshPro)/ tmp_Count_Old(旧版·UGUI Text):哪份拖了用哪份,新版优先
/// tmp_Name 道具名字文本(新版·TextMeshPro)/ tmp_Name_Old(旧版·UGUI Text):同上
/// obj_Drawn 已抽中的遮罩:抽中后显示
/// obj_Selecting 抽奖选择过程中选中的高亮:跑马灯经过本格时显示
/// obj_Landed 最后抽中停留的标识:跑马灯停在本格时显示
///
/// Init 时按数据显隐:没奖品就隐藏图片/数量/名字和三个状态标识,只留格子背景。
///
/// itemId = 本格子的位置编号(对应 prizeId 后两位,如 588203 → 3),
/// 初始化时奖品按它对号入座,Inspector 里按美术摆放顺序填 1、2、3……
/// </summary>
public class ChouJiangItem : MonoBehaviour
{
[Header("本格子配置")]
[Tooltip("本格子的位置编号 = prizeId 后两位(如 588203 → 3),初始化时奖品按它对号入座")]
public int itemId;
[Header("显示控件(都可留空,留空则该项不处理)")]
[Tooltip("奖品图片控件:代码把金币/钻石/下载的图标换到这张图上")]
public Image img_Icon;
[Tooltip("数量文本(新版·TextMeshPro):优先用它")]
public TextMeshProUGUI tmp_Count;
[Tooltip("数量文本(旧版·UGUI Text):新版没拖时才用它")]
public Text tmp_Count_Old;
[Tooltip("道具名字文本(新版·TextMeshPro):优先用它;名字数据为空则隐藏")]
public TextMeshProUGUI tmp_Name;
[Tooltip("道具名字文本(旧版·UGUI Text):新版没拖时才用它")]
public Text tmp_Name_Old;
[Tooltip("已抽中的遮罩:该奖品抽中后显示")]
public GameObject obj_Drawn;
[Tooltip("抽奖选择过程中选中的高亮:跑马灯经过本格时显示")]
public GameObject obj_Selecting;
[Tooltip("最后抽中停留的标识:跑马灯停在本格时显示")]
public GameObject obj_Landed;
[Tooltip("是否使用网络图标:关闭则道具/碎片不下载网络图,保留你摆好的本地图")]
public bool useNetIcon = true;
[Header("奖励数据(Init 时由代码填充,Play 模式选中物体可实时查看)")]
[Tooltip("道具信息 + 奖励详细信息(prizeId/名称/图标/类型/数量/道具 product/权重/库存)")]
public LotteryPrize prize;
[Tooltip("是否已被抽中(奖励不重复,抽中后显示遮罩)")]
[SerializeField] private bool isDrawn;
/// <summary>是否已被抽中</summary>
public bool IsDrawn => isDrawn;
// 金币/钻石本地图标(Resources 根目录,与 BackPackPropItem 同一套),静态缓存避免重复加载
private static Sprite _goldSprite;
private static Sprite _diamondSprite;
/// <summary>
/// 记录奖励数据并展示;传 null 表示本格子这次没有奖品。
/// 该显示的显示、该隐藏的隐藏:没奖品时图片/数量/名字/三个状态标识全部隐藏,只留格子背景。
/// </summary>
public void Init(LotteryPrize prize)
{
this.prize = prize;
bool has = prize != null;
// 数量:有奖品才显示
SetText(tmp_Count, tmp_Count_Old, has ? prize.count.ToString() : string.Empty, has);
// 名字:有奖品且有名字数据才显示
bool hasName = has && !string.IsNullOrEmpty(prize.name);
SetText(tmp_Name, tmp_Name_Old, hasName ? prize.name : string.Empty, hasName);
// 图片:有奖品才显示(没奖品隐藏,避免残留上一次的图标)
if (img_Icon != null)
{
img_Icon.gameObject.SetActive(has);
if (has) SetPrizeIcon(img_Icon, prize);
}
// 三个状态标识复位:抽中遮罩 / 选中高亮 / 抽中停留
RefreshDrawnState(false);
ShowSelecting(false);
ShowLanded(false);
}
/// <summary>已抽中的遮罩:抽中后显示</summary>
public void RefreshDrawnState(bool drawn)
{
isDrawn = drawn;
if (obj_Drawn != null) obj_Drawn.SetActive(drawn);
}
/// <summary>跑马灯经过本格时显示「选中」高亮</summary>
public void ShowSelecting(bool show)
{
if (obj_Selecting != null) obj_Selecting.SetActive(show);
}
/// <summary>跑马灯停在本格时显示「抽中停留」标识</summary>
public void ShowLanded(bool show)
{
if (obj_Landed != null) obj_Landed.SetActive(show);
}
/// <summary>
/// 写文本并按需显隐:新版(TextMeshPro)优先,新版没拖才用旧版(UGUI Text);
/// 两份都拖了时旧版隐藏,避免格子里出现两份重复文本。两份都没拖就整个跳过(不处理)。
/// </summary>
private static void SetText(TextMeshProUGUI newTmp, Text oldTxt, string text, bool show)
{
if (newTmp != null)
{
newTmp.text = text;
newTmp.gameObject.SetActive(show);
if (oldTxt != null) oldTxt.gameObject.SetActive(false); // 用了新版就把旧版藏起来
}
else if (oldTxt != null)
{
oldTxt.text = text;
oldTxt.gameObject.SetActive(show);
}
}
/// <summary>
/// 设置奖励图标:1=金币 / 2=钻石 用 Resources 本地图,
/// 3=道具 / 4=道具碎片 下载 icon(为空时用 product.imageUrl)。
/// icon 是相对路径(如 /uploads/11028.png)时拼 baseURL;
/// 下载失败时用固定格式 /uploads/编号.png 兜底(编号优先 otherId,其次 product.number)。
/// useNetIcon=false 时不下载网络图,保留预制体上摆好的本地图。
/// </summary>
private void SetPrizeIcon(Image img, LotteryPrize prize)
{
switch (prize.type)
{
case 1: // 金币
Sprite gold = _goldSprite != null ? _goldSprite
: (_goldSprite = Resources.Load<Sprite>("gold"));
if (gold != null) img.sprite = gold;
break;
case 2: // 钻石
Sprite diamond = _diamondSprite != null ? _diamondSprite
: (_diamondSprite = Resources.Load<Sprite>("diamond"));
if (diamond != null) img.sprite = diamond;
break;
default: // 道具/碎片:下载图标
if (!useNetIcon) return; // 关闭网络图:保留本地图不换
string url = prize.icon;
if (string.IsNullOrEmpty(url) && prize.product != null)
url = prize.product.imageUrl;
url = ToFullUrl(url);
// 兜底地址:格式固定 /uploads/编号.png
string num = !string.IsNullOrEmpty(prize.otherId) ? prize.otherId
: (prize.product != null ? prize.product.number : "");
string fallback = string.IsNullOrEmpty(num) ? null
: APIManager.baseURL + "/uploads/" + num + ".png";
if (!string.IsNullOrEmpty(url))
{
WebTool.DownImage(url, tex =>
{
// 回调触发时本物体可能已被销毁(关闭面板清空父节点),需判空
if (this == null || img == null) return;
if (tex != null)
{
img.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height),
Vector2.one * 0.5f);
return;
}
// 下载失败 → 固定格式 /uploads/编号.png 重试一次
if (!string.IsNullOrEmpty(fallback) && fallback != url)
DownloadTo(fallback, img);
});
}
else if (!string.IsNullOrEmpty(fallback))
{
// icon 为空直接走兜底
DownloadTo(fallback, img);
}
break;
}
}
/// <summary>下载图片并贴到 img(回调时判销毁)</summary>
private static void DownloadTo(string url, Image img)
{
WebTool.DownImage(url, tex =>
{
if (img == null) return; // 静态回调不能判 this,只判 img
if (tex != null)
img.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height),
Vector2.one * 0.5f);
});
}
/// <summary>相对路径(/uploads/xx.png)拼 baseURL,完整 http 地址原样返回</summary>
private static string ToFullUrl(string url)
{
if (string.IsNullOrEmpty(url)) return url;
if (url.StartsWith("http")) return url;
return APIManager.baseURL + url;
}
}
@@ -369,7 +369,7 @@ public class ChouJiangPanel : SubUIBase
// 抽中结果(结算 UI 摆好后在这里接入)
Debug.Log($"[ChouJiangPanel] 抽中:{res.name} x{res.count}(type={res.type},消耗={res.cost},分组={(LotteryPoolType)res.poolType})");
// 跑马灯动效:跳到抽中的格子上停住,结束后刷新状态解锁按钮(方块预制体在各 ChouJiangItem 格子上)
// 跑马灯动效:在格子的「选中」高亮间滚动,停稳后显示中奖格的「抽中停留」标识,结束后刷新状态解锁按钮
ChouJiangToggle cur = GetCurrentToggle();
if (cur != null)
{
@@ -176,8 +176,9 @@ public class ChouJiangToggle : MonoBehaviour
/// <summary>
/// 播放抽奖动效:跑马灯在格子间 加速→匀速→减速 跳动,最后停在 prizeId 对应的格子上。
/// 方块是各格子自己的 prefab_DrawEffect(ChouJiangItem 上拖),经过/停留时点亮。
/// 完成后回调 onComplete;没有任何格子配方块/找不到目标格时立即回调。
/// 滚动过程用各格子自己的「选中」高亮(obj_Selecting),停稳后显示目标格的「抽中停留」标识(obj_Landed)。
/// 一个格子都没配「选中」高亮时不做滚动,只标记中奖格。
/// 找不到目标格时立即回调。
/// </summary>
public void PlayDrawEffect(string prizeId, Action onComplete)
{
@@ -187,14 +188,21 @@ public class ChouJiangToggle : MonoBehaviour
List<ChouJiangItem> path = BuildEffectPath();
ChouJiangItem target = FindItemByPrizeId(prizeId);
bool anyEffect = false;
for (int i = 0; i < path.Count; i++)
if (path.Count == 0 || target == null || !path.Contains(target))
{
if (path[i].prefab_DrawEffect != null) { anyEffect = true; break; }
onComplete?.Invoke();
return;
}
if (!anyEffect || path.Count == 0 || target == null || !path.Contains(target))
// 没有任何格子配「选中」高亮 → 不滚动,只标记中奖格
bool anySelecting = false;
for (int i = 0; i < path.Count; i++)
{
if (path[i].obj_Selecting != null) { anySelecting = true; break; }
}
if (!anySelecting)
{
target.ShowLanded(true);
onComplete?.Invoke();
return;
}
@@ -252,9 +260,10 @@ public class ChouJiangToggle : MonoBehaviour
int targetIdx = path.IndexOf(target);
int cur = 0;
// 全部先熄灭(含上一次中奖格上亮着的方块),点亮起点
for (int i = 0; i < count; i++) path[i].ShowEffect(false);
path[0].ShowEffect(true);
// 全部先复位(含上一次停留的高亮/中奖标识),点亮起点
for (int i = 0; i < count; i++) path[i].ShowSelecting(false);
target.ShowLanded(false);
path[0].ShowSelecting(true);
// 总步数 = 圈数 × 格子数 + 到目标格的距离,保证最后一步正好落在目标格
int totalSteps = effectLoops * count + (targetIdx - cur + count) % count;
@@ -263,12 +272,15 @@ public class ChouJiangToggle : MonoBehaviour
{
float p = (float)step / totalSteps;
yield return new WaitForSeconds(GetStepDuration(p));
path[cur].ShowEffect(false); // 熄灭当前格
path[cur].ShowSelecting(false); // 熄灭当前格
cur = (cur + 1) % count;
path[cur].ShowEffect(true); // 点亮下一格
path[cur].ShowSelecting(true); // 点亮下一格
}
// 停在目标格上停留一下再回调(中奖格的方块保持亮着)
// 停稳:滚动高亮收掉,显示中奖格的「抽中停留」标识
path[cur].ShowSelecting(false);
target.ShowLanded(true);
yield return new WaitForSeconds(0.6f);
onComplete?.Invoke();
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f46ae0eb60266e74895b1b529a0c1df5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 107 KiB

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5d047a21cddb90f48ab57d7b4f052a92
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 4bf9910688988ea4caa73e78e0c86258
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 79e73d120d4e13740810d5d3b07754ff
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 486d3178af820a04793bfd5554d39119
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 717f15389a7790240b7485bb79a9225f
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: c96c8c881eb7b924cbcb02bee2457504
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 5a856a325233a5844b0ee6f4dcc0eb97
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 0929a3b19d0109b45be7ce7145388e7a
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 35463ab9dcb2c97408e2613e7362b305
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 1d71535e789b15c4b9796d55e3ddfc56
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: c83e48fa184111e47afdcafb6783a5e1
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: dfae0931646d4474798592f46bf3e76b
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
@@ -1,298 +0,0 @@
using Assets.Framework.Tool;
using Assets.MyGame.Scripts.Net;
using Assets.MyGame.Scripts.Net.API.GameConfig_SubClass;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 抽奖 item 层(第三层):挂在 toggle 层里的每个奖品格子上,
/// 记录道具信息以及奖励的详细信息(prize:类型/数量/权重/库存/道具 product 等),
/// 并负责展示——图标 + 数量文本由代码动态生成在格子下;
/// 已抽中的奖项置灰(奖励不重复)。
///
/// itemId = 本格子的位置编号(对应 prizeId 后两位,如 588203 → 3),
/// 初始化时奖品按它对号入座,Inspector 里按美术摆放顺序填 1、2、3……
/// </summary>
public class ChouJiangItem : MonoBehaviour
{
[Tooltip("本格子的位置编号 = prizeId 后两位(如 588203 → 3),初始化时奖品按它对号入座")]
public int itemId;
[Tooltip("本格子的跑马灯方块预制体:抽奖动效经过/停在本格子时点亮,大小自动设成格子(背景)大小")]
public GameObject prefab_DrawEffect;
[Header("动态生成参数")]
[Tooltip("图标占格子短边的比例")]
public float iconRatio = 0.85f;
[Tooltip("奖品大小系数:统一/微调各格子奖品图标的整体大小(1=按 iconRatio,>1 放大 <1 缩小)")]
public float prizeScale = 1f;
[Tooltip("图标中心相对格子中心的纵向偏移(0=居中,负数=往下贴)")]
public float iconOffsetY = 0f;
[Tooltip("是否使用网络图标(prize.icon):关闭则不下载网络图片,道具/碎片格子不显示图标(金币/钻石仍用本地图)")]
public bool useNetIcon = true;
[Tooltip("数量文本字号")]
public float fontSize = 22f;
[Tooltip("是否显示数量文本(关闭则本格子不生成数量)")]
public bool showCount = true;
[Tooltip("已抽中置灰的颜色")]
public Color drawnColor = new Color(0.35f, 0.35f, 0.35f, 0.5f);
[Tooltip("遮罩蒙版图片(可选):适配不规则格子;蒙版大小=格子(背景)大小,图标放进蒙版里被裁出形状")]
public Sprite maskSprite;
[Header("奖励数据(Init 时由代码填充,Play 模式选中物体可实时查看)")]
[Tooltip("道具名字文本(可选):拖 TextMeshProUGUI 才显示名字,留空或名字数据为空则不显示")]
public TextMeshProUGUI tmp_Name;
[Tooltip("道具信息 + 奖励详细信息(prizeId/名称/图标/类型/数量/道具 product/权重/库存)")]
public LotteryPrize prize;
[Tooltip("是否已被抽中(奖励不重复,抽中后置灰)")]
[SerializeField] private bool isDrawn;
/// <summary>是否已被抽中</summary>
public bool IsDrawn => isDrawn;
private Image img_Icon; // 动态生成的图标
private TextMeshProUGUI tmp_Count; // 动态生成的数量文本
private GameObject maskObj; // 动态生成的遮罩蒙版(不规则裁剪用)
private GameObject effectObj; // 本格子的跑马灯方块实例(懒创建)
// 金币/钻石本地图标(Resources 根目录,与 BackPackPropItem 同一套),静态缓存避免重复加载
private static Sprite _goldSprite;
private static Sprite _diamondSprite;
/// <summary>记录奖励数据并展示(图标 + 数量)</summary>
public void Init(LotteryPrize prize)
{
this.prize = prize; // 记录道具信息以及奖励的详细信息
ClearUI();
if (prize == null) return;
RectTransform rt = transform as RectTransform;
if (rt == null)
{
Debug.LogWarning($"[ChouJiangItem] 格子不是 UI(缺 RectTransform):{name}");
return;
}
float w = rt.rect.width, h = rt.rect.height;
if (w < 1f || h < 1f) { w = 90f; h = 79f; } // 无尺寸兜底
// 遮罩蒙版:大小=格子(背景)大小,图标放进蒙版里被裁出形状(适配不规则格子)
RectTransform iconParent = rt;
if (maskSprite != null)
iconParent = CreateMask(rt, w, h);
// 图标:方形占短边 iconRatio × prizeScale(各格子可单独调奖品大小),居中(iconOffsetY 可微调)
float side = Mathf.Min(w, h) * iconRatio * Mathf.Max(0.01f, prizeScale);
img_Icon = CreateIcon(iconParent, side);
SetPrizeIcon(img_Icon, prize);
// 数量:压在图标底部(文字叠在图片上面,不进蒙版);showCount 关闭则不生成
if (showCount)
{
tmp_Count = CreateCountText(rt, w, side);
tmp_Count.text = prize.count.ToString();
}
// 道具名字(可选):拖了 tmp_Name 才显示,名字数据为空也隐藏
if (tmp_Name != null)
tmp_Name.text = string.IsNullOrEmpty(prize.name) ? "" : prize.name;
// 新数据默认未抽中,已抽列表由面板 Init 后统一刷新
RefreshDrawnState(false);
}
/// <summary>置灰/恢复(奖励不重复,抽中后置灰)</summary>
public void RefreshDrawnState(bool drawn)
{
isDrawn = drawn;
if (img_Icon != null)
img_Icon.color = drawn ? drawnColor : Color.white;
}
/// <summary>
/// 显示/隐藏本格子的跑马灯方块:第一次点亮时用 prefab_DrawEffect 创建实例,
/// 大小自动设成格子(背景)大小、压在最上层。
/// </summary>
public void ShowEffect(bool show)
{
if (show && effectObj == null && prefab_DrawEffect != null)
{
RectTransform rt = transform as RectTransform;
if (rt != null)
{
effectObj = Instantiate(prefab_DrawEffect, rt, false);
RectTransform er = effectObj.transform as RectTransform;
if (er != null)
{
er.anchorMin = er.anchorMax = er.pivot = Vector2.one * 0.5f;
er.anchoredPosition = Vector2.zero;
er.localScale = Vector3.one;
er.sizeDelta = new Vector2(rt.rect.width, rt.rect.height); // 方块大小 = 背景大小
}
effectObj.transform.SetAsLastSibling();
}
}
if (effectObj != null)
effectObj.SetActive(show);
}
/// <summary>清掉动态生成的 UI(重复 Init 复用前调用)</summary>
public void ClearUI()
{
if (img_Icon != null) { Destroy(img_Icon.gameObject); img_Icon = null; }
if (tmp_Count != null) { Destroy(tmp_Count.gameObject); tmp_Count = null; }
if (maskObj != null) { Destroy(maskObj); maskObj = null; }
}
/// <summary>生成遮罩蒙版:Image(maskSprite)+ Mask,居中、大小=格子(背景)大小;图标放它下面被裁剪</summary>
private RectTransform CreateMask(RectTransform parent, float w, float h)
{
maskObj = new GameObject("Mask", typeof(RectTransform));
RectTransform r = (RectTransform)maskObj.transform;
r.SetParent(parent, false);
r.anchorMin = r.anchorMax = r.pivot = Vector2.one * 0.5f;
r.anchoredPosition = Vector2.zero;
// 遮罩 0.9 倍背景大小(试过比全尺寸好看)
r.sizeDelta = new Vector2(w * 0.9f, h * 0.9f);
Image maskImg = maskObj.AddComponent<Image>();
maskImg.sprite = maskSprite;
maskImg.raycastTarget = false;
// 只当裁剪形状用,不显示蒙版图本身
Mask mask = maskObj.AddComponent<Mask>();
mask.showMaskGraphic = false;
return r;
}
/// <summary>生成格子里的图标物体(往下贴 iconOffsetY)</summary>
private Image CreateIcon(RectTransform parent, float side)
{
GameObject go = new GameObject("Icon", typeof(RectTransform));
RectTransform r = (RectTransform)go.transform;
r.SetParent(parent, false);
r.anchorMin = r.anchorMax = r.pivot = Vector2.one * 0.5f;
r.anchoredPosition = new Vector2(0f, iconOffsetY);
r.sizeDelta = new Vector2(side, side);
Image img = go.AddComponent<Image>();
img.raycastTarget = false;
return img;
}
/// <summary>生成压在图标底部的数量文本</summary>
private TextMeshProUGUI CreateCountText(RectTransform parent, float w, float iconSide)
{
GameObject go = new GameObject("Count", typeof(RectTransform));
RectTransform r = (RectTransform)go.transform;
r.SetParent(parent, false);
r.anchorMin = r.anchorMax = r.pivot = Vector2.one * 0.5f;
// 图标底边往上 0.8 个字高:文字压在图片上面
r.anchoredPosition = new Vector2(0f, iconOffsetY - iconSide / 2f + fontSize * 0.8f);
r.sizeDelta = new Vector2(w, fontSize * 1.6f);
TextMeshProUGUI tmp = go.AddComponent<TextMeshProUGUI>();
TMP_FontAsset font = TMP_Settings.defaultFontAsset;
if (font != null) tmp.font = font;
tmp.fontSize = fontSize;
tmp.alignment = TextAlignmentOptions.Center;
tmp.color = Color.white;
tmp.raycastTarget = false;
return tmp;
}
/// <summary>
/// 设置奖励图标:1=金币 / 2=钻石 用 Resources 本地图,
/// 3=道具 / 4=道具碎片 下载 icon(为空时用 product.imageUrl)。
/// 新版数据 icon 是相对路径(如 /uploads/11028.png),需拼 baseURL;
/// 下载失败时用固定格式 /uploads/编号.png 兜底(编号优先 otherId,其次 product.number)。
/// useNetIcon=false 时道具/碎片不下载网络图(icon 即网络图),格子不显示图标。
/// </summary>
private void SetPrizeIcon(Image img, LotteryPrize prize)
{
switch (prize.type)
{
case 1: // 金币
Sprite gold = _goldSprite != null ? _goldSprite
: (_goldSprite = Resources.Load<Sprite>("gold"));
if (gold != null) img.sprite = gold;
break;
case 2: // 钻石
Sprite diamond = _diamondSprite != null ? _diamondSprite
: (_diamondSprite = Resources.Load<Sprite>("diamond"));
if (diamond != null) img.sprite = diamond;
break;
default: // 道具/碎片:下载图标
// 关闭网络图标:不下载任何网络图,本格子不显示图标(避免留一个空白方块)
if (!useNetIcon)
{
img.enabled = false;
return;
}
string url = prize.icon;
if (string.IsNullOrEmpty(url) && prize.product != null)
url = prize.product.imageUrl;
url = ToFullUrl(url);
// 兜底地址:格式固定 /uploads/编号.png
string num = !string.IsNullOrEmpty(prize.otherId) ? prize.otherId
: (prize.product != null ? prize.product.number : "");
string fallback = string.IsNullOrEmpty(num) ? null
: APIManager.baseURL + "/uploads/" + num + ".png";
if (!string.IsNullOrEmpty(url))
{
WebTool.DownImage(url, tex =>
{
// 回调触发时本物体可能已被销毁(关闭面板清空父节点),需判空
if (this == null || img == null) return;
if (tex != null)
{
img.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height),
Vector2.one * 0.5f);
return;
}
// 下载失败 → 固定格式 /uploads/编号.png 重试一次
if (!string.IsNullOrEmpty(fallback) && fallback != url)
DownloadTo(fallback, img);
});
}
else if (!string.IsNullOrEmpty(fallback))
{
// icon 为空直接走兜底
DownloadTo(fallback, img);
}
break;
}
}
/// <summary>下载图片并贴到 img(回调时判销毁)</summary>
private static void DownloadTo(string url, Image img)
{
WebTool.DownImage(url, tex =>
{
if (img == null) return; // 静态回调不能判 this,只判 img
if (tex != null)
img.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height),
Vector2.one * 0.5f);
});
}
/// <summary>相对路径(/uploads/xx.png)拼 baseURL,完整 http 地址原样返回</summary>
private static string ToFullUrl(string url)
{
if (string.IsNullOrEmpty(url)) return url;
if (url.StartsWith("http")) return url;
return APIManager.baseURL + url;
}
private void OnDestroy()
{
ClearUI();
}
}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a999b4125d888044eb1e5907deaf678f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4c2ebd04b4d4a7544845c3853fbafe17
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,409 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
serializedVersion: 7
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: BY_ShenHaiBaoZangPanel_cx_UGUI_BY_ShenHaiBaoZangBeastWindow
m_Legacy: 1
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.33333334
value: {x: 1.8, y: 0.6, z: 1}
inSlope: {x: -2.5494518, y: 1.2598165, z: 0}
outSlope: {x: -2.5494518, y: 1.2598165, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.059769988, y: 0.06551713, z: 0.33333334}
- serializedVersion: 3
time: 0.5833333
value: {x: 0.98, y: 0.98, z: 1}
inSlope: {x: 0, y: 0.38399965, z: 0}
outSlope: {x: 0, y: 0.38399965, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.75
value: {x: 1.02, y: 1.02, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.9
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: root/Title
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.6666667
value: {x: 0.8, y: 0.5, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.93333334
value: {x: 1.05, y: 1.08, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1.0833334
value: {x: 0.99, y: 0.97, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1.25
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: root/TakeBtn
m_FloatCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.33333334
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.5833333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: root/Title/Title (1)
classID: 114
script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.6666667
value: 0.1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.9166667
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: root/TipBtn
classID: 114
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.6666667
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: root/TipBtn
classID: 1
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.8333333
value: 0.01
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1.1666666
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: root/CloseBtn
classID: 114
script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.6666667
value: 0.01
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: root/Tips_1
classID: 114
script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.6666667
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.8833333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: root/TakeBtn/TakeBtn_1
classID: 114
script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.41666666
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: root/Title/eff_liuguang
classID: 1
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.6666667
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: root/TakeBtn
classID: 1
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.6666667
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: root/Tips_1
classID: 1
script: {fileID: 0}
flags: 0
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 1
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: be0801e0b43c9644aa6ba9191c1dd8a3
timeCreated: 1791730977
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,379 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
serializedVersion: 7
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: BY_ShenHaiBaoZangPanel_cx_UGUI_BY_ShenHaiBaoZangWarGodWindow
m_Legacy: 1
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.33333334
value: {x: 1.8, y: 0.6, z: 1}
inSlope: {x: -2.5494518, y: 1.2598165, z: 0}
outSlope: {x: -2.5494518, y: 1.2598165, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.059769988, y: 0.06551713, z: 0.33333334}
- serializedVersion: 3
time: 0.5833333
value: {x: 0.98, y: 0.98, z: 1}
inSlope: {x: 0, y: 0.38399965, z: 0}
outSlope: {x: 0, y: 0.38399965, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.75
value: {x: 1.02, y: 1.02, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.9
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: root/Title
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.6666667
value: {x: 0.8, y: 0.5, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.93333334
value: {x: 1.05, y: 1.08, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1.0833334
value: {x: 0.99, y: 0.97, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1.25
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: root/TakeBtn
m_FloatCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.33333334
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.5833333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: root/Title
classID: 114
script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.6666667
value: 0.1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.9166667
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: root/TipBtn
classID: 114
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.6666667
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: root/TipBtn
classID: 1
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.8333333
value: 0.01
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1.1666666
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: root/CloseBtn
classID: 114
script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.6666667
value: 0.01
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: root/Tips_1
classID: 114
script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.6666667
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.8833333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: root/TakeBtn/TakeBtn_1
classID: 114
script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.6666667
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: root/TakeBtn
classID: 1
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.6666667
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: root/Tips_1
classID: 1
script: {fileID: 0}
flags: 0
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 1
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 97ecaa831c3d15044a0257cf67c8769b
timeCreated: 1791730977
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,409 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
serializedVersion: 7
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: BY_ShenHaiBaoZangPanel_cx_UGUI_BY_ShenHaiBaoZangWeaponWindow
m_Legacy: 1
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.33333334
value: {x: 1.8, y: 0.6, z: 1}
inSlope: {x: -2.5494518, y: 1.2598165, z: 0}
outSlope: {x: -2.5494518, y: 1.2598165, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.059769988, y: 0.06551713, z: 0.33333334}
- serializedVersion: 3
time: 0.5833333
value: {x: 0.98, y: 0.98, z: 1}
inSlope: {x: 0, y: 0.38399965, z: 0}
outSlope: {x: 0, y: 0.38399965, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.75
value: {x: 1.02, y: 1.02, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.9
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: root/Title
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.6666667
value: {x: 0.8, y: 0.5, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.93333334
value: {x: 1.05, y: 1.08, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1.0833334
value: {x: 0.99, y: 0.97, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1.25
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: root/TakeBtn
m_FloatCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.33333334
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.5833333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: root/Title
classID: 114
script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.6666667
value: 0.1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.9166667
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: root/TipBtn
classID: 114
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.6666667
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: root/TipBtn
classID: 1
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.8333333
value: 0.01
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1.1666666
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: root/CloseBtn
classID: 114
script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.6666667
value: 0.01
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: root/Tips_1
classID: 114
script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.6666667
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.8833333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: root/TakeBtn/TakeBtn_1
classID: 114
script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.41666666
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: root/Title/eff_liuguang
classID: 1
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.6666667
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: root/TakeBtn
classID: 1
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.6666667
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: root/Tips_1
classID: 1
script: {fileID: 0}
flags: 0
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 1
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 4ab6e0027592d114090fbc57e97ecdf4
timeCreated: 1791730977
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,105 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
serializedVersion: 7
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ItemGrid_cx_101_UGUI_Image
m_Legacy: 1
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0.5, y: 0.5, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.21666667
value: {x: 1.2, y: 1.2, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.38333333
value: {x: 0.95, y: 0.95, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.55
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: cc35155287115594098b7531e2fc16be
timeCreated: 1791730977
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,105 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
serializedVersion: 7
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ItemGrid_cx_101_UGUI_Image
m_Legacy: 1
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0.5, y: 0.5, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.21666667
value: {x: 1.2, y: 1.2, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.38333333
value: {x: 0.95, y: 0.95, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.55
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: e4f8e300255a2da4883e1fb7cc6d4c6d
timeCreated: 1791730977
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,135 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
serializedVersion: 7
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ItemGrid_cx_101_UGUI_RawImage
m_Legacy: 1
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0.5, y: 0.5, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.21666667
value: {x: 1.2, y: 1.2, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.38333333
value: {x: 0.95, y: 0.95, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.55
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
m_FloatCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.21666667
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path:
classID: 114
script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
flags: 0
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 32e41506fa349394780d8f213fb1a35f
timeCreated: 1791730977
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,135 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
serializedVersion: 7
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ItemGrid_cx_101_UGUI_RawImage
m_Legacy: 1
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0.5, y: 0.5, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.21666667
value: {x: 1.2, y: 1.2, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.38333333
value: {x: 0.95, y: 0.95, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.55
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
m_FloatCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.21666667
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path:
classID: 114
script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
flags: 0
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 9fcbc759dfc0b724a988cfe28ae1b8ab
timeCreated: 1791730977
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,135 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
serializedVersion: 7
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ItemGrid_cx_101_UGUI_RawImage
m_Legacy: 1
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0.5, y: 0.5, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.21666667
value: {x: 1.2, y: 1.2, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.38333333
value: {x: 0.95, y: 0.95, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.55
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
m_FloatCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.21666667
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path:
classID: 114
script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
flags: 0
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 7157dfad5f04cef4f87b7a03c2c511de
timeCreated: 1791730977
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9fda7ba84219c7041adfc0234a371c65
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,114 @@
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.Text.RegularExpressions;
/// <summary>
/// 大厅图集切片烘焙工具(绕开 TextureImporter 管线,纯 Unity API):
/// 1. 读取 NGUI 图集 prefab 的 mSprites 坐标
/// 2. Sprite.Create 从大图切出 56 个 sprite,AssetDatabase.CreateAsset 落盘
/// 3. 大厅 prefab 里 108 个 Image 按节点语义规则重绑切片
/// 菜单:Tools / 烘焙大厅图集切片
/// </summary>
public static class BakeLobbySlicesTool
{
const string AtlasPrefabPath = "Assets/dataresources/atlas/a大厅/atlas_bylobbyclassic/Atlas_ByLobbyClassic.prefab";
const string AtlasTexPath = "Assets/dataresources/atlas/a大厅/atlas_bylobbyclassic/Atlas_ByLobbyClassic.png";
const string OutDir = "Assets/BakeLobbySlicesAssets";
const string LobbyPrefabPath = "Assets/bundles/by_lobby/bundles/panel/BY_LbPlayMainUGUIPanel.prefab";
[MenuItem("Tools/烘焙大厅图集切片")]
public static void Bake()
{
// ---------- 1. 读图集坐标 ----------
var atlasObj = AssetDatabase.LoadAssetAtPath<Object>(AtlasPrefabPath);
if (atlasObj == null) { Debug.LogError("[烘焙] 图集 prefab 加载失败: " + AtlasPrefabPath); return; }
var so = new SerializedObject(atlasObj);
var mSprites = so.FindProperty("mSprites");
if (mSprites == null || !mSprites.isArray || mSprites.arraySize == 0)
{ Debug.LogError("[烘焙] mSprites 读取失败 (arraySize=" + (mSprites == null ? -1 : mSprites.arraySize) + ")"); return; }
var tex = AssetDatabase.LoadAssetAtPath<Texture2D>(AtlasTexPath);
if (tex == null) { Debug.LogError("[烘焙] 大图加载失败,请先等 Unity 刷新完成: " + AtlasTexPath); return; }
Debug.Log($"[烘焙] 图集 {mSprites.arraySize} 切片, 大图 {tex.width}x{tex.height}");
// ---------- 2. 切片落盘 ----------
if (!AssetDatabase.IsValidFolder(OutDir)) AssetDatabase.CreateFolder("Assets", "BakeLobbySlicesAssets");
var made = new Dictionary<string, Sprite>();
for (int i = 0; i < mSprites.arraySize; i++)
{
var el = mSprites.GetArrayElementAtIndex(i);
string name = el.FindPropertyRelative("name").stringValue;
var rect = new Rect(el.FindPropertyRelative("x").floatValue, el.FindPropertyRelative("y").floatValue,
el.FindPropertyRelative("width").floatValue, el.FindPropertyRelative("height").floatValue);
var border = new Vector4(el.FindPropertyRelative("borderLeft").floatValue, el.FindPropertyRelative("borderBottom").floatValue,
el.FindPropertyRelative("borderRight").floatValue, el.FindPropertyRelative("borderTop").floatValue);
var sp = Sprite.Create(tex, rect, new Vector2(0.5f, 0.5f), 100f, 0, SpriteMeshType.FullRect, border);
sp.name = name;
var path = $"{OutDir}/{name}.asset";
AssetDatabase.DeleteAsset(path);
AssetDatabase.CreateAsset(sp, path);
made[name] = sp;
}
Debug.Log($"[烘焙] 生成 {made.Count} 个 sprite asset → {OutDir}");
// ---------- 3. 重绑大厅 prefab ----------
var root = PrefabUtility.LoadPrefabContents(LobbyPrefabPath);
int bound = 0, missing = 0;
try
{
var images = root.GetComponentsInChildren<UnityEngine.UI.Image>(true);
foreach (var img in images)
{
var sp = PickSlice(img.gameObject.name, made);
if (sp != null) { img.sprite = sp; bound++; }
else missing++;
}
PrefabUtility.SaveAsPrefabAsset(root, LobbyPrefabPath);
}
finally { PrefabUtility.UnloadPrefabContents(root); }
Debug.Log($"[烘焙] prefab 重绑 {bound} 个 Image, 未匹配 {missing} 个 —— 完成!");
}
// 节点名 → 切片(与此前 Python 修复用的语义规则一致,最后有兜底)
static Sprite PickSlice(string n, Dictionary<string, Sprite> m)
{
string s = null;
if (Regex.IsMatch(n, @"Frame_bg$")) s = "topbar_frame";
else if (n.Contains("Frame_lobby")) s = "topbar_def2";
else if (n.Contains("topbar_btn")) s = "topbar_btn";
else if (n.Contains("BtnClassic") || n == "Classic") s = "ic_tab_n1";
else if (n.Contains("BtnSuper") || n == "Super") s = "ic_tab_n2";
else if (n.Contains("BtnSiuxian") || n == "Siuxian") s = "ic_tab_n3";
else if (n.Contains("BtnFold")) s = "ic_tab_n4";
else if (n.StartsWith("tab_sel")) s = "tab_sel1";
else if (n.Contains("tab_bg")) s = "tab_bg";
else if (n.Contains("share_btn_bg")) s = "nor_frame_b";
else if (n.Contains("icon_more")) s = "icon_more";
else if (n.Contains("redDot")) s = "com_redDot";
else if (n.Contains("arrow") || n.Contains("jiantou")) s = "arrow";
else if (n == "bg_arrow") s = "bg_arrow";
else if (Regex.IsMatch(n, @"^(gem|gold|money|energy|bp)_bg")) s = "icon_bg";
else if (n.EndsWith("_spr")) s = "icon_bg2";
else if (n.Contains("headIcon")) s = "s_frame_p";
else if (n.Contains("player_level") || n.Contains("vip_spr")) s = "s_frame_r";
else if (n.EndsWith("_btn")) s = "btn";
else if (n.Contains("Frame") || n.Contains("frame")) s = "nor_frame_b2";
else if (n.StartsWith("eff_") || n.Contains("_eff")) s = "effect_1";
else if (n.Contains("lizi") || n.Contains("glow") || n.Contains("star") || n.Contains("sanguang")) s = "tx_mask";
else if (Regex.IsMatch(n, @"^bg( \(\d+\))?$")) s = "nor_frame_b";
else if (Regex.IsMatch(n, @"^Background( \(\d+\))?$")) s = "nor_frame_b2";
else if (n.Contains("ContentRoot")) s = "icon_bg";
else if (n.Contains("GodGuardTab") || n.Contains("ActivityCenter")) s = "tab_bg02";
else if (n.Contains("propIcon")) s = "icon_bg3";
else if (n.Contains("propTip")) s = "ls_txk_1";
else if (n.Contains("setup_bg")) s = "icon_bg3";
else if (n.Contains("musicOpen")) s = "icon_cardSystem_Bubble01";
else if (n.Contains("hlby_") || n.Contains("hong_spr")) s = "icon_cardSystem_Bubble02";
else if (n == "zi" || n.Contains("Label") || n.EndsWith("lab")) s = "txt_y_1";
else if (Regex.IsMatch(n, @"^Sprite( \(\d+\))?$")) s = "icon_bg2";
if (s != null && m.ContainsKey(s)) return m[s];
return m.ContainsKey("icon_bg2") ? m["icon_bg2"] : null; // 兜底
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f6a3beb0f1bea6743becefb7271d8b07
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,115 @@
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.Reflection;
/// <summary>
/// 纯视觉 Prefab 生成器:剥掉所有逻辑脚本,只保留表现组件。
/// 用法:Project 窗口选中一个/多个 prefab → Tools → 生成纯视觉Prefab
/// 输出:同目录 &lt;原名&gt;_Visual.prefab(不覆盖原文件)
///
/// 保留白名单:Unity 内置表现组件、UGUI、TMP、Spine、Animancer、DOTween、URP Volume
/// 删除:其余所有 MonoBehaviour(BY_* 游戏逻辑、LuaBehaviour、FMOD、NGUI 等)
/// Missing 脚本(原逻辑脚本移除后的残留)同时清理。
/// </summary>
public static class StripVisualPrefabTool
{
// 表现类程序集/命名空间白名单
static readonly string[] KeepNamespaces = {
"UnityEngine.UI", "TMPro", "Spine", "Spine.Unity", "Animancer",
"DG.Tweening", "UnityEngine.Rendering", "UnityEngine.U2D",
"UnityEngine", "UnityEngine.Experimental",
};
// 表现类程序集名(.dll)
static readonly string[] KeepAssemblies = {
"UnityEngine.UI", "Unity.TextMeshPro", "Unity.Timeline",
"Spine", "Spine.Unity", "Animancer", "DOTween", "DOTweenPro",
"Unity.RenderPipelines.Core.Runtime", "Unity.RenderPipelines.Universal.Runtime",
"Unity.2D.Animation.Runtime", "Unity.Animator2D",
"Assembly-CSharp", // 视觉辅助:UIGradient/TextSpacing/Outline8/Z1_EffectFollow 等
};
[MenuItem("Tools/生成纯视觉Prefab(剥离逻辑脚本)")]
public static void StripSelected()
{
// 收集目标:选中的 prefab + 选中文件夹下递归的所有 prefab
var prefabPaths = new HashSet<string>();
foreach (var obj in Selection.objects)
{
var path = AssetDatabase.GetAssetPath(obj);
if (string.IsNullOrEmpty(path)) continue;
if (path.EndsWith(".prefab")) prefabPaths.Add(path);
else if (System.IO.Directory.Exists(path))
{
foreach (var f in System.IO.Directory.GetFiles(path, "*.prefab", System.IO.SearchOption.AllDirectories))
prefabPaths.Add(f.Replace('\\', '/'));
}
}
if (prefabPaths.Count == 0) { Debug.LogError("[纯视觉] 未找到 prefab——请选中 prefab 或包含 prefab 的文件夹"); return; }
Debug.Log($"[纯视觉] 共 {prefabPaths.Count} 个 prefab 待处理...");
int done = 0;
foreach (var path in prefabPaths) { StripOne(path); done++; }
Debug.Log($"[纯视觉] 处理完成 {done} 个 prefab(输出为 *_Visual.prefab)");
}
[MenuItem("Tools/生成纯视觉Prefab(剥离逻辑脚本)", true)]
static bool Validate() { return Selection.objects != null && Selection.objects.Length > 0; }
static void StripOne(string path)
{
var root = PrefabUtility.LoadPrefabContents(path);
int removed = 0;
try
{
// 1. 删除非白名单 MonoBehaviour
var mbs = root.GetComponentsInChildren<MonoBehaviour>(true);
var toRemove = new List<Component>();
foreach (var mb in mbs)
{
if (mb == null) continue;
if (!IsVisual(mb)) toRemove.Add(mb);
}
foreach (var c in toRemove) { Object.DestroyImmediate(c, true); removed++; }
// 2. 清理 Missing 脚本组件(serialized 里的 m_Script 已失效的)
foreach (var t in root.GetComponentsInChildren<Transform>(true))
RemoveMissingScripts(t.gameObject);
// 3. 另存
string dir = System.IO.Path.GetDirectoryName(path).Replace('\\', '/');
string name = System.IO.Path.GetFileNameWithoutExtension(path);
string newPath = $"{dir}/{name}_Visual.prefab";
PrefabUtility.SaveAsPrefabAsset(root, newPath);
Debug.Log($"[纯视觉] {name} → {newPath} (剥离 {removed} 个逻辑组件)");
}
finally { PrefabUtility.UnloadPrefabContents(root); }
}
static bool IsVisual(Component c)
{
var t = c.GetType();
// 程序集白名单(精确优先)
var asm = t.Assembly.GetName().Name;
foreach (var k in KeepAssemblies)
if (asm == k) return true;
// 命名空间白名单
var ns = t.Namespace ?? "";
foreach (var k in KeepNamespaces)
if (ns == k || ns.StartsWith(k + ".")) return true;
return false;
}
static void RemoveMissingScripts(GameObject go)
{
var so = new SerializedObject(go);
var comps = so.FindProperty("m_Component");
for (int i = comps.arraySize - 1; i >= 0; i--)
{
var comp = comps.GetArrayElementAtIndex(i).FindPropertyRelative("component");
if (comp != null && comp.objectReferenceValue == null)
comps.DeleteArrayElementAtIndex(i);
}
so.ApplyModifiedPropertiesWithoutUndo();
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 08151b804de85fe4095e31e99127a036
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 419b04d9281a76f49bc374ff2e929456
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d08023c411dc83e479bee7e9ecb4f1f0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d9475a073cf79b3429b647d30e36ca32
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,34 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: FX_Glow_Soft
m_Shader: {fileID: 10720, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 2800000, guid: 379d27081e1d19a489bf9d55abbb3bb3, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats: []
m_Colors:
- _TintColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 63379909a73748daa12e37f7edc256a8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,34 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: FX_Liuguang_Particles
m_Shader: {fileID: 10720, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 2800000, guid: a1b2c3d4e5f60718293a4b5c6d7e8f90, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats: []
m_Colors:
- _TintColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b2c3d4e5f60718293a4b5c6d7e8f90a1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

@@ -0,0 +1,126 @@
fileFormatVersion: 2
guid: a1b2c3d4e5f60718293a4b5c6d7e8f90
timeCreated: 1767545842
licenseType: Free
TextureImporter:
serializedVersion: 13
internalIDToNameTable: []
externalObjects: {}
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 51
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 0
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 0
flipbookColumns: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
output:
textureImportInstructions:
compressedFormat: 0
uncompressedFormat: 0
desiredFormat: 0
usageMode: 0
colorSpace: 0
androidETC2FallbackFormat: 0
width: 0
height: 0
depth: 0
cubeIntermediateSize: 0
cubeMode: 0
cubeLayout: 0
compressionQuality: 0
androidETC2FallbackDownscale: 0
vtOnly: 0
sourceTextureInformation:
width: 0
height: 0
doesTextureContainAlpha: 0
sourceWasHDR: 0
importInspectorWarnings:
pSDRemoveMatte: 0
userData:
assetBundleName: assets_dataresources_effect_textures2_c9.bundle
assetBundleVariant:
@@ -0,0 +1,34 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: FX_Ring_Gold
m_Shader: {fileID: 10720, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 2800000, guid: 36b3bb14397a18046846ac1613aceaf0, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats: []
m_Colors:
- _TintColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bed9e4348d6c401ab248e74e580eba70
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,29 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: FX_Ring_Purple
m_Shader: {fileID: 10720, guid: 0000000000000000f000000000000000, type: 0}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 2800000, guid: 29ab72fe9a5642e3bc5a843b68cb0381, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: []
m_Colors:
- _TintColor: {r: 1, g: 1, b: 1, a: 1}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 949d4d978d8b466eb54f91e7842d4426
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@@ -0,0 +1,101 @@
fileFormatVersion: 2
guid: 29ab72fe9a5642e3bc5a843b68cb0381
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 0
flipbookColumns: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,34 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: FX_Sparkle_Gold
m_Shader: {fileID: 10720, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 2800000, guid: b6db406b2995b88409c234363862f675, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats: []
m_Colors:
- _TintColor: {r: 1, g: 0.75, b: 0.25, a: 1}
m_BuildTextureStacks: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b77dc32474ba4b98a49bb799550af26c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,51 @@
Shader "Custom/UIParticleAdditive" {
Properties {
_MainTex ("Particle Texture", 2D) = "white" {}
_TintColor ("Tint Color", Color) = (1,1,1,1)
}
SubShader {
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
Blend SrcAlpha One
Cull Off Lighting Off ZWrite Off
Fog { Color (0,0,0,0) }
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#include "UnityCG.cginc"
sampler2D _MainTex;
fixed4 _TintColor;
float4 _MainTex_ST;
struct appdata_t {
float4 vertex : POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f {
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
v2f vert (appdata_t v) {
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.color = v.color * _TintColor;
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
return o;
}
fixed4 frag (v2f i) : SV_Target {
fixed4 col = 2.0f * i.color * tex2D(_MainTex, i.texcoord);
col.a = saturate(col.a);
return col;
}
ENDCG
}
}
Fallback Off
}

Some files were not shown because too many files have changed in this diff Show More