Esempio n. 1
0
        /// <summary>
        /// 根据名称获取程序集中的类型
        /// </summary>
        /// <param name="assembly">程序集名称,例如:SSJJ,Start</param>
        /// <param name="typeName">类型名称,必须包含完整的命名空间,例如:SSJJ.Render.BulletRail</param>
        /// <returns>类型</returns>
        public static Type GetAssemblyType(string assembly, string typeName)
        {
            Type t;

            if (Application.platform == RuntimePlatform.Android || Application.isEditor)
            {
                t = AssemblyManager.GetAssembly(assembly).GetType(typeName);
            }
            //其他平台使用默认程序集中的类型
            else
            {
                t = AssemblyManager.DefaultCSharpAssembly.GetType(typeName);
            }

            return(t);
        }