using System.Collections; using System.Collections.Generic; using UnityEngine; using JCUnityLib; using System.Linq; using UnityEngine.UI; public class HomeView_BottomBarView : MonoBehaviour { // Start is called before the first frame update void Start() { Dictionary actionMap = new Dictionary { { "IconConnect", null }, { "IconGuider", null }, //{ "IconShop", null }, //{ "IconNewUser", null }, { "IconFriend", null }, { "IconRank", null }, { "IconSetUp", null } }; SortChildObjects(actionMap); // 按条件禁用特定按钮的交互性 switch (CommonConfig.OP) { case OperatingPlatform.B: DisableButtonInteractivity(actionMap, new List { "IconGuider", "IconFriend", "IconRank" }); break; } } void DisableButtonInteractivity(Dictionary actionMap, List buttonNames) { foreach (var buttonName in buttonNames) { // 检查 actionMap 中是否有该键且对应的 Transform 不为 null if (actionMap.TryGetValue(buttonName, out Transform buttonTransform) && buttonTransform != null) { Image image = buttonTransform.GetComponent(); if (image != null) { image.color = new Color(200f / 255f, 200f / 255f, 200f / 255f, 130f / 255f); } Button button = buttonTransform.GetComponent