少年修仙传客户端代码仓库
client_Wu Xijin
2019-02-21 f353e7d662f673d295367a10b8713fb306789135
3335 添加窗口关闭全部时忽略的窗口配置
2个文件已添加
2个文件已修改
64 ■■■■ 已修改文件
Core/ResModule/AssetBundle/AssetBundleUtility.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/WindowBase/WindowCenter.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/CloseAllIgnoreWindowConfig.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/CloseAllIgnoreWindowConfig.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/ResModule/AssetBundle/AssetBundleUtility.cs
@@ -48,6 +48,7 @@
    public void ReInitBuiltInAsset()
    {
        WindowConfig.Release();
        CloseAllIgnoreWindowConfig.Release();
        UnloadAssetBundle("builtin/scriptableobjects", true, false);
        var path = AssetVersionUtility.GetBuiltInAssetFilePath("builtin_assetbundle");
System/WindowBase/WindowCenter.cs
@@ -14,13 +14,6 @@
        public event Action<Window> windowAfterCloseEvent;
        public event Action<Window> jumpWindowCloseEvent;
        List<string> closeAllIgnoreWindows = new List<string>() {
                     "MessageWin", "NewBieWin", "NewItemGetWin", "AttributePromoteShowWin" ,"DungeonBeginCoolDownWin","DungeonFightWin","StatusTipWin"
                     ,"ScrollTipWin","MarqueeWin","ExperienceOpenWin","TrumpetWin","BattlePrepareCoolDownWin","DungeonGradeWin","BattleHintWin",
                     "TreasureDungeonMissionHintWin","FairyGrabBossHintWin","DungeonFairyFeastHintWin","PetAndMountPushWin","UpgradeWin","DungeonFairyLandWin"
                     ,"GatherSoulDungeonHintWin"
                 };
        UIRoot m_UIRoot;
        public UIRoot uiRoot {
            get {
@@ -230,16 +223,16 @@
                        isIgnore = window.windowInfo.windowType <= WindowType.Base;
                        break;
                    case CloseAllIgnoreType.BaseAndCustom:
                        isIgnore = window.windowInfo.windowType <= WindowType.Base || closeAllIgnoreWindows.Contains(name);
                        isIgnore = window.windowInfo.windowType <= WindowType.Base || CloseAllIgnoreWindowConfig.IsIgnore(name);
                        break;
                    case CloseAllIgnoreType.System:
                        isIgnore = window.windowInfo.windowType >= WindowType.System;
                        break;
                    case CloseAllIgnoreType.Custom:
                        isIgnore = closeAllIgnoreWindows.Contains(name);
                        isIgnore = CloseAllIgnoreWindowConfig.IsIgnore(name);
                        break;
                    case CloseAllIgnoreType.SystemAndCustom:
                        isIgnore = window.windowInfo.windowType >= WindowType.System || closeAllIgnoreWindows.Contains(name);
                        isIgnore = window.windowInfo.windowType >= WindowType.System || CloseAllIgnoreWindowConfig.IsIgnore(name);
                        break;
                }
@@ -303,16 +296,16 @@
                        isIgnore = windowNames.Contains(name) || window.windowInfo.windowType <= WindowType.Base;
                        break;
                    case CloseAllIgnoreType.BaseAndCustom:
                        isIgnore = windowNames.Contains(name) || window.windowInfo.windowType <= WindowType.Base || closeAllIgnoreWindows.Contains(name);
                        isIgnore = windowNames.Contains(name) || window.windowInfo.windowType <= WindowType.Base || CloseAllIgnoreWindowConfig.IsIgnore(name);
                        break;
                    case CloseAllIgnoreType.System:
                        isIgnore = windowNames.Contains(name) || window.windowInfo.windowType >= WindowType.System;
                        break;
                    case CloseAllIgnoreType.Custom:
                        isIgnore = windowNames.Contains(name) || closeAllIgnoreWindows.Contains(name);
                        isIgnore = windowNames.Contains(name) || CloseAllIgnoreWindowConfig.IsIgnore(name);
                        break;
                    case CloseAllIgnoreType.SystemAndCustom:
                        isIgnore = windowNames.Contains(name) || window.windowInfo.windowType >= WindowType.System || closeAllIgnoreWindows.Contains(name);
                        isIgnore = windowNames.Contains(name) || window.windowInfo.windowType >= WindowType.System || CloseAllIgnoreWindowConfig.IsIgnore(name);
                        break;
                }
Utility/CloseAllIgnoreWindowConfig.cs
New file
@@ -0,0 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(menuName = "Config/CloseAllIgnoreWindowConfig")]
public class CloseAllIgnoreWindowConfig : ScriptableObject
{
    [SerializeField] List<string> m_Windows;
    public bool IsIgnoreWindow(string window)
    {
        return m_Windows.Contains(window);
    }
    static CloseAllIgnoreWindowConfig config = null;
    public static bool IsIgnore(string window)
    {
        if (config == null)
        {
            config = BuiltInLoader.LoadScriptableObject<CloseAllIgnoreWindowConfig>("CloseAllIgnoreWindowConfig");
        }
        return config.IsIgnoreWindow(window);
    }
    public static void Release()
    {
        config = null;
    }
}
Utility/CloseAllIgnoreWindowConfig.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b7fc1a00b63c1cb41bc2adc39f6e988b
timeCreated: 1550728464
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant: