CSLE.CLS_Environment.RegType C# (CSharp) Method

RegType() public method

public RegType ( ICLS_Type type ) : void
type ICLS_Type
return void
        public void RegType(ICLS_Type type)
        {
            types[type.type] = type;

            string typename = type.keyword;
            //if (useNamespace)
            //{

            //    if (string.IsNullOrEmpty(type._namespace) == false)
            //    {
            //        typename = type._namespace + "." + type.keyword;
            //    }
            //}
            if (string.IsNullOrEmpty(typename))
            {//匿名自动注册
            }
            else
            {
                typess[typename] = type;
                if (tokenParser.types.Contains(typename) == false)
                {
                    tokenParser.types.Add(typename);
                }
            }
        }

Usage Example

Example #1
0
 public static void InitCSLight()
 {
     env = new CSLE.CLS_Environment(new Logger());
     //env.RegType(new CSLE.RegHelper_Type(typeof(GameObject)));
     env.RegType(new MYGameObject());
     //env.RegType(new CSLE.RegHelper_Type(typeof(Debug)));
     env.RegType(new MYDebug());
     //env.RegType(new CSLE.RegHelper_Type(typeof(Transform)));
     env.RegType(new MYTransform());
     env.RegType(new CSLE.RegHelper_Type(typeof(Camera)));
     env.RegType(new CSLE.RegHelper_Type(typeof(Vector3)));
 }
All Usage Examples Of CSLE.CLS_Environment::RegType