少年修仙传客户端基础资源
hch
2024-12-10 650351d224145cc692715571fc2178378bff393a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
 
namespace UnityEngine.AssetBundles.AssetBundleDataSource
{
    public class ABDataSourceProviderUtility {
 
        private static List<Type> s_customNodes;
 
        public static List<Type> CustomABDataSourceTypes {
            get {
                if(s_customNodes == null) {
                    s_customNodes = BuildCustomABDataSourceList();
                }
                return s_customNodes;
            }
        }
 
        private static List<Type> BuildCustomABDataSourceList() {
            var list = new List<Type>(Assembly
                .GetExecutingAssembly()
                .GetTypes()
                .Where(t => t != typeof(ABDataSource))
                .Where(t => typeof(ABDataSource).IsAssignableFrom(t)) );
 
 
            var properList = new List<Type>();
            properList.Add(null); //empty spot for "default" 
            for(int count = 0; count < list.Count; count++)
            {
                if(list[count].Name == "AssetDatabaseABDataSource")
                    properList[0] = list[count];
                else
                    properList.Add(list[count]);
            }
 
            return properList;
        }
    }
}