コード例 #1
0
        public static void GenerateCode1()
        {
            MethodGenerator method = new MethodGenerator("Test");

            method.SetAuthority(MethodAuthorityType.Internal);
            method.SetDecorate(MethodDecorateType.Virtual);
            method.SetParms(new string[] { "int", "string" });
            method.SetReturn("bool");
            MethodGenerator method1 = new MethodGenerator("Test1");

            method1.SetAuthority(MethodAuthorityType.Internal);
            method1.SetDecorate(MethodDecorateType.Virtual);
            method1.SetParms(new string[] { "int", "string" });
            method1.SetReturn("bool");
            ClassGenerator textClass = new ClassGenerator("TestClass");

            textClass.SetUsingName(new string[] { "xxxx", "aaaa" });
            textClass.SetBaseClass("xxcvsdf");
            textClass.SetDecorate(ClassDecorateType.Abstract);
            textClass.SetAuthority(AuthorityType.Public);
            textClass.SetInterfaces(new string[] { "asdfsadf", "asdfasdf" });
            textClass.SetNamespace("masdjf");
            textClass.AddMethod(method);
            textClass.AddMethod(method1);
            string classValue = textClass.ToString();

            TxtUtility.StringToFile(classValue);
        }
コード例 #2
0
        public static void GenerateCode3()
        {
            ProtoGenerator textClass = new ProtoGenerator("TestClass");

            textClass.SetNamespace("MM");
            textClass.AddProperty("id", "int");
            textClass.AddProperty("id1", "int");
            string classValue = textClass.ToString();

            TxtUtility.StringToFile(classValue);
            //Debug.Log(classValue);
        }