Exemplo n.º 1
0
        public override void execute()
        {
            Template target = new Template(AssetPathUtility.DataAccessorTemplatePath, false);
            target.Set("className", className);
            target.Set("namespace", ns);
            target.Set("getCases", CreateGetCases());
            target.Set("setCases", CreateSetCases());

            string folderPath = AssetPathUtility.DataAccessorGeneratePath;
            string generatePath = NamingRuleUtility.CreateDataAccessorGeneratePath(className);
            GenerateCode(folderPath, generatePath, target.ToString());
        }
Exemplo n.º 2
0
        public override void execute()
        {
            Template target = new Template(AssetPathUtility.DataScriptTemplatePath, false);
            target.Set("className", className);
            target.Set ("superClass", superClassName);

            string variableCode = "";

            foreach(KeyValuePair<string, string> pair in variables) {
                string line = "		public " + pair.Value + " " + pair.Key + ";";
                variableCode += line + System.Environment.NewLine;
            }

            target.Set("variables", variableCode);

            string folderPath = AssetPathUtility.DataScriptGeneratePath;
            string generatePath = NamingRuleUtility.CreateDataScriptGeneratePath(className);
            GenerateCode(folderPath, generatePath, target.ToString());
        }
Exemplo n.º 3
0
        public override void execute()
        {
            Template target = new Template(AssetPathUtility.AccessorManagerTemplatePath, false);
            target.Set("className", className);

            string createCode = "";

            foreach(string name in dataClassNames) {
                createCode += "		obj = prefab.GetComponent<" + name + ">();";
                createCode += System.Environment.NewLine;
                createCode += "		if(obj != null) return new " + name + "DataAccessor(obj);";
                createCode += System.Environment.NewLine;
            }

            target.Set("createCode", createCode);

            string folderPath = AssetPathUtility.AccessorManagerGeneratePath;
            string generatePath = NamingRuleUtility.CreateAccessorManagerGeneratePath(className);
            GenerateCode(folderPath, generatePath, target.ToString());
        }