From bc1cb6da854cb2e9144f10ed55330a537ecdca16 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 04 三月 2026 14:35:57 +0800
Subject: [PATCH] 466 h5版本 资源规则修改 打包修改(未完成 勿拉取)
---
Main/Component/UI/Common/EnableButtonConfig.cs | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/Main/Component/UI/Common/EnableButtonConfig.cs b/Main/Component/UI/Common/EnableButtonConfig.cs
index 0605280..34eaf96 100644
--- a/Main/Component/UI/Common/EnableButtonConfig.cs
+++ b/Main/Component/UI/Common/EnableButtonConfig.cs
@@ -3,6 +3,7 @@
using UnityEngine;
using System;
using UnityEngine.UI;
+using Cysharp.Threading.Tasks;
[CreateAssetMenu(menuName = "Config/EnableButtonConfig")]
public class EnableButtonConfig : ScriptableObject
{
@@ -12,9 +13,9 @@
public static Dictionary<EnableButtonType, EnableButtonConfig> dict = new Dictionary<EnableButtonType, EnableButtonConfig>();
- public static void SetEnable(Button _btn, Text _text, bool _enable, EnableButtonType _type)
+ public static async UniTask SetEnable(Button _btn, Text _text, bool _enable, EnableButtonType _type)
{
- var _cfg = GetEnableButtonCfg(_type);
+ var _cfg = await GetEnableButtonCfg(_type);
var _btnStyle = _enable ? _cfg.enableButton : _cfg.unEnableButton;
_btn.interactable = _enable;
var _colors = _btn.colors;
@@ -25,13 +26,13 @@
_text.color = _btnStyle.fontColor;
}
- public static EnableButtonConfig GetEnableButtonCfg(EnableButtonType _type)
+ public static async UniTask<EnableButtonConfig> GetEnableButtonCfg(EnableButtonType _type)
{
if (dict.ContainsKey(_type))
{
return dict[_type];
}
- var _cfg= BuiltInLoader.LoadScriptableObject<EnableButtonConfig>(StringUtility.Concat("EnableButton_", _type.ToString()));
+ var _cfg = await BuiltInLoader.LoadScriptableObjectAsync<EnableButtonConfig>(StringUtility.Concat("EnableButton_", _type.ToString()));
dict.Add(_type, _cfg);
return _cfg;
}
--
Gitblit v1.8.0