Example #1
0
        // Token: 0x060002D0 RID: 720 RVA: 0x0000D7D4 File Offset: 0x0000B9D4
        public Type LoadType(TypeDNName typeDNName)
        {
            Type type;

            if (!this.m_typeDict.TryGetValue(typeDNName.m_typeFullName, out type))
            {
                Assembly assembly;
                if (string.IsNullOrEmpty(typeDNName.m_assemblyName))
                {
                    assembly = this.m_assembleDict["Assembly-CSharp"];
                }
                else if (!this.m_assembleDict.TryGetValue(typeDNName.m_assemblyName, out assembly))
                {
                    return(null);
                }
                type = assembly.GetType(typeDNName.m_typeFullName);
                if (type == null)
                {
                    Debug.LogError(string.Format("Can not find type {0}", typeDNName.m_typeFullName));
                    return(null);
                }
                this.m_typeDict[typeDNName.m_typeFullName] = type;
            }
            return(type);
        }
Example #2
0
        // Token: 0x060002CF RID: 719 RVA: 0x0000D7AC File Offset: 0x0000B9AC
        public object CreateInstance(TypeDNName typeDNName, params object[] args)
        {
            Type type = this.LoadType(typeDNName);

            if (type == null)
            {
                return(null);
            }
            return(Activator.CreateInstance(type, args));
        }