Exemple #1
0
        /// <summary>
        /// 根据不同的类名构建不同的资源预处理器
        /// </summary>
        public static ABEntryProcessor Create(ABEntry rABEntry)
        {
            ABEntryProcessor rEntryProcessor = null;

            Type rType = Type.GetType(rABEntry.abClassName);

            if (rType == null)
            {
                rEntryProcessor = new ABEntryProcessor();
            }
            else
            {
                rEntryProcessor = ReflectionAssist.Construct(rType) as ABEntryProcessor;
            }

            rEntryProcessor.Entry = rABEntry;

            return(rEntryProcessor);
        }
Exemple #2
0
        /// <summary>
        /// 根据不同的类名构建不同的资源预处理器
        /// </summary>
        public static ABEntryProcessor Create(ABEntry rABEntry)
        {
            ABEntryProcessor rEntryProcessor = null;

            Type rType = Type.GetType(rABEntry.abClassName);

            if (rType == null)
            {
                var rAllAssembies = System.AppDomain.CurrentDomain.GetAssemblies();
                for (int i = 0; i < rAllAssembies.Length; i++)
                {
                    if (rAllAssembies[i].GetName().Name.Equals("Game.Editor"))
                    {
                        var rAllTypes = rAllAssembies[i].GetTypes();
                        for (int j = 0; j < rAllTypes.Length; j++)
                        {
                            if (rAllTypes[j].FullName.Equals(rABEntry.abClassName))
                            {
                                rType = rAllTypes[j];
                            }
                        }
                    }
                }
            }

            if (rType == null)
            {
                rEntryProcessor = new ABEntryProcessor();
            }
            else
            {
                rEntryProcessor = ReflectionAssist.Construct(rType) as ABEntryProcessor;
            }

            rEntryProcessor.Entry = rABEntry;

            return(rEntryProcessor);
        }