示例#1
0
        public static void Initialize(bool registerSystem, bool registerUnity, bool registerCustom)
        {
            DebugUtil.Log("Reset Domain");
            ccq2itype.Clear();
            type2itype.Clear();
            str2itype.Clear();

            DebugUtil.Log("Register Base Type");
            //注册基本类型
            RegisterType(new Type_String());
            RegisterType(new Type_Var());
            RegisterType(new Type_Bool());
            RegisterType(new Type_Lambda());
            RegisterType(new Type_Delegate());
            str2itype["null"] = new Type_NULL();

            RegisterType <double>("double");
            RegisterType <float>("float");
            RegisterType <long>("long");
            RegisterType <ulong>("ulong");
            RegisterType <int>("int");
            RegisterType <uint>("uint");
            RegisterType <short>("short");
            RegisterType <ushort>("ushort");
            RegisterType <byte>("byte");
            RegisterType <sbyte>("sbyte");
            RegisterType <char>("char");

            RegisterType <object>("object");
            RegisterType <IEnumerator>("IEnumerator");

            RegisterType(typeof(List <>), "System.Collections.Generic.List");                   //模板类要独立注册
            RegisterType(typeof(Dictionary <,>), "System.Collections.Generic.Dictionary");
            RegisterType(typeof(Stack <>), "System.Collections.Stack");
            RegisterType(typeof(Queue <>), "System.Collections.Queue");

            RegisterType <System.Action> ();


            if (registerSystem)
            {
                RegisterTypes.RegisterSystemTypes();
            }
            if (registerUnity)
            {
                RegisterTypes.RegisterUnityTypes();
            }
            if (registerCustom)
            {
                RegisterTypes.RegisterCustomTypes();
            }
        }