diff --git a/CMakeLists.txt b/CMakeLists.txt index f1ee8400..6ca6a78f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ cmake_minimum_required (VERSION 2.8) # set(CMAKE_CONFIGURATION_TYPES "Debug;Release;Profile" CACHE STRING "" FORCE) set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE) -set (BEHAVIAC_PACKAGE_VERSION 3.6.36) +set (BEHAVIAC_PACKAGE_VERSION 3.6.37) #option( BUILD_SHARED_LIBS "set to OFF to build static libraries" ON ) SET(BUILD_SHARED_LIBS ON CACHE BOOL "set to OFF to build static libraries") diff --git a/README.md b/README.md index edd56231..7af9b17c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://github.com/Tencent/behaviac/blob/master/license.txt) -[![Release Version](https://img.shields.io/badge/release-3.6.35-red.svg)](https://github.com/Tencent/behaviac/releases) +[![Release Version](https://img.shields.io/badge/release-3.6.37-red.svg)](https://github.com/Tencent/behaviac/releases) [![Updates](https://img.shields.io/badge/Platform-%20iOS%20%7C%20OS%20X%20%7C%20Android%20%7C%20Windows%20%7C%20Linux%20-brightgreen.svg)](https://github.com/Tencent/behaviac/blob/master/history.txt) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/behaviac/pulls) diff --git a/history.txt b/history.txt index fa58b330..ab92f96b 100644 --- a/history.txt +++ b/history.txt @@ -1,5 +1,8 @@ +2017-08-08 3.6.37 + Support generating the codes for initializing the member array. + 2017-08-03 3.6.36 - fix a bug of accessing task params when calling a sub tree + Fix a bug of accessing task params when calling a sub tree 2017-7-11 3.6.35 Improve the C++ types generation. diff --git a/inc/behaviac/common/_config.h b/inc/behaviac/common/_config.h index e2b0c90a..51877025 100644 --- a/inc/behaviac/common/_config.h +++ b/inc/behaviac/common/_config.h @@ -11,5 +11,5 @@ #define BEHAVIAC_RELEASE 0 #endif -#define BEHAVIAC_VERSION_STRING "3.6.36" +#define BEHAVIAC_VERSION_STRING "3.6.37" diff --git a/inc/behaviac/common/member.h b/inc/behaviac/common/member.h index da6c31cf..c849bd73 100644 --- a/inc/behaviac/common/member.h +++ b/inc/behaviac/common/member.h @@ -590,11 +590,11 @@ namespace behaviac { return NULL; } -#if !BEHAVIAC_RELEASE - virtual bool IsArrayItem() { +//#if !BEHAVIAC_RELEASE + virtual bool IsArrayItem() const { return false; } -#endif +//#endif }; template @@ -815,12 +815,12 @@ namespace behaviac { return this->_name.c_str(); } -#if !BEHAVIAC_RELEASE +//#if !BEHAVIAC_RELEASE public: - virtual bool IsArrayItem() { + virtual bool IsArrayItem() const { return false; } -#endif +//#endif public: CProperty(const char* name) { @@ -995,12 +995,12 @@ namespace behaviac { _gfp = gfp; } -#if !BEHAVIAC_RELEASE +//#if !BEHAVIAC_RELEASE public: - virtual bool IsArrayItem() { + virtual bool IsArrayItem() const { return true; } -#endif +//#endif public: virtual const void* GetValueElement(const behaviac::Agent* self, int index) const { @@ -1096,12 +1096,12 @@ namespace behaviac { _gfp = gfp; } -#if !BEHAVIAC_RELEASE +//#if !BEHAVIAC_RELEASE public: - virtual bool IsArrayItem() { + virtual bool IsArrayItem() const { return true; } -#endif +//#endif public: virtual const void* GetValueElement(const behaviac::Agent* self, int index) const { @@ -1476,12 +1476,12 @@ namespace behaviac { _parentId = parentId; } -#if !BEHAVIAC_RELEASE +//#if !BEHAVIAC_RELEASE public: - virtual bool IsArrayItem() { + virtual bool IsArrayItem() const { return true; } -#endif +//#endif public: virtual bool IsCustomized() const { @@ -1527,12 +1527,12 @@ namespace behaviac { _parentId = parentId; } -#if !BEHAVIAC_RELEASE +//#if !BEHAVIAC_RELEASE public: - virtual bool IsArrayItem() { + virtual bool IsArrayItem() const { return true; } -#endif +//#endif public: virtual bool IsCustomized() const { diff --git a/integration/demo_running/behaviac/Base/Meta.cs b/integration/demo_running/behaviac/Base/Meta.cs index c1cea9e3..86550b0f 100644 --- a/integration/demo_running/behaviac/Base/Meta.cs +++ b/integration/demo_running/behaviac/Base/Meta.cs @@ -339,6 +339,8 @@ public ICustomizedProperty CreateCustomizedArrayItemProperty(uint id, string nam public static string GetTypeName(string typeName) { typeName = typeName.Replace("*", ""); + //typeName = typeName.Replace("<", "<"); + //typeName = typeName.Replace(">", ">"); return typeName; } diff --git a/integration/demo_running/behaviac/version.txt b/integration/demo_running/behaviac/version.txt index 6aff5cd2..51d5fef5 100644 --- a/integration/demo_running/behaviac/version.txt +++ b/integration/demo_running/behaviac/version.txt @@ -1 +1 @@ -3.6.36 +3.6.37 diff --git a/integration/unity/Assets/Scripts/behaviac/runtime/Base/Meta.cs b/integration/unity/Assets/Scripts/behaviac/runtime/Base/Meta.cs index c1cea9e3..86550b0f 100644 --- a/integration/unity/Assets/Scripts/behaviac/runtime/Base/Meta.cs +++ b/integration/unity/Assets/Scripts/behaviac/runtime/Base/Meta.cs @@ -339,6 +339,8 @@ public ICustomizedProperty CreateCustomizedArrayItemProperty(uint id, string nam public static string GetTypeName(string typeName) { typeName = typeName.Replace("*", ""); + //typeName = typeName.Replace("<", "<"); + //typeName = typeName.Replace(">", ">"); return typeName; } diff --git a/integration/unity/Assets/Scripts/behaviac/runtime/version.txt b/integration/unity/Assets/Scripts/behaviac/runtime/version.txt index 6aff5cd2..51d5fef5 100644 --- a/integration/unity/Assets/Scripts/behaviac/runtime/version.txt +++ b/integration/unity/Assets/Scripts/behaviac/runtime/version.txt @@ -1 +1 @@ -3.6.36 +3.6.37 diff --git a/projects/gmake/Makefile b/projects/gmake/Makefile new file mode 100644 index 00000000..fb418819 --- /dev/null +++ b/projects/gmake/Makefile @@ -0,0 +1,148 @@ +# GNU Make solution makefile autogenerated by Premake +# Type "make help" for usage help + +ifndef config + config=debugstatic32 +endif +export config + +PROJECTS := behaviac btunittest btremotetest demo_running usertest tutorial_1 tutorial_1_1 tutorial_1_2 tutorial_2 tutorial_3 tutorial_4 tutorial_5 tutorial_6 tutorial_7 tutorial_8 tutorial_9 tutorial_10 tutorial_11 tutorial_12 tutorial_13 + +.PHONY: all clean help $(PROJECTS) + +all: $(PROJECTS) + +behaviac: + @echo "==== Building behaviac ($(config)) ====" + @${MAKE} --no-print-directory -C . -f behaviac.make + +btunittest: behaviac + @echo "==== Building btunittest ($(config)) ====" + @${MAKE} --no-print-directory -C . -f btunittest.make + +btremotetest: behaviac + @echo "==== Building btremotetest ($(config)) ====" + @${MAKE} --no-print-directory -C . -f btremotetest.make + +demo_running: behaviac + @echo "==== Building demo_running ($(config)) ====" + @${MAKE} --no-print-directory -C . -f demo_running.make + +usertest: behaviac + @echo "==== Building usertest ($(config)) ====" + @${MAKE} --no-print-directory -C . -f usertest.make + +tutorial_1: behaviac + @echo "==== Building tutorial_1 ($(config)) ====" + @${MAKE} --no-print-directory -C . -f tutorial_1.make + +tutorial_1_1: behaviac + @echo "==== Building tutorial_1_1 ($(config)) ====" + @${MAKE} --no-print-directory -C . -f tutorial_1_1.make + +tutorial_1_2: behaviac + @echo "==== Building tutorial_1_2 ($(config)) ====" + @${MAKE} --no-print-directory -C . -f tutorial_1_2.make + +tutorial_2: behaviac + @echo "==== Building tutorial_2 ($(config)) ====" + @${MAKE} --no-print-directory -C . -f tutorial_2.make + +tutorial_3: behaviac + @echo "==== Building tutorial_3 ($(config)) ====" + @${MAKE} --no-print-directory -C . -f tutorial_3.make + +tutorial_4: behaviac + @echo "==== Building tutorial_4 ($(config)) ====" + @${MAKE} --no-print-directory -C . -f tutorial_4.make + +tutorial_5: behaviac + @echo "==== Building tutorial_5 ($(config)) ====" + @${MAKE} --no-print-directory -C . -f tutorial_5.make + +tutorial_6: behaviac + @echo "==== Building tutorial_6 ($(config)) ====" + @${MAKE} --no-print-directory -C . -f tutorial_6.make + +tutorial_7: behaviac + @echo "==== Building tutorial_7 ($(config)) ====" + @${MAKE} --no-print-directory -C . -f tutorial_7.make + +tutorial_8: behaviac + @echo "==== Building tutorial_8 ($(config)) ====" + @${MAKE} --no-print-directory -C . -f tutorial_8.make + +tutorial_9: behaviac + @echo "==== Building tutorial_9 ($(config)) ====" + @${MAKE} --no-print-directory -C . -f tutorial_9.make + +tutorial_10: behaviac + @echo "==== Building tutorial_10 ($(config)) ====" + @${MAKE} --no-print-directory -C . -f tutorial_10.make + +tutorial_11: behaviac + @echo "==== Building tutorial_11 ($(config)) ====" + @${MAKE} --no-print-directory -C . -f tutorial_11.make + +tutorial_12: behaviac + @echo "==== Building tutorial_12 ($(config)) ====" + @${MAKE} --no-print-directory -C . -f tutorial_12.make + +tutorial_13: behaviac + @echo "==== Building tutorial_13 ($(config)) ====" + @${MAKE} --no-print-directory -C . -f tutorial_13.make + +clean: + @${MAKE} --no-print-directory -C . -f behaviac.make clean + @${MAKE} --no-print-directory -C . -f btunittest.make clean + @${MAKE} --no-print-directory -C . -f btremotetest.make clean + @${MAKE} --no-print-directory -C . -f demo_running.make clean + @${MAKE} --no-print-directory -C . -f usertest.make clean + @${MAKE} --no-print-directory -C . -f tutorial_1.make clean + @${MAKE} --no-print-directory -C . -f tutorial_1_1.make clean + @${MAKE} --no-print-directory -C . -f tutorial_1_2.make clean + @${MAKE} --no-print-directory -C . -f tutorial_2.make clean + @${MAKE} --no-print-directory -C . -f tutorial_3.make clean + @${MAKE} --no-print-directory -C . -f tutorial_4.make clean + @${MAKE} --no-print-directory -C . -f tutorial_5.make clean + @${MAKE} --no-print-directory -C . -f tutorial_6.make clean + @${MAKE} --no-print-directory -C . -f tutorial_7.make clean + @${MAKE} --no-print-directory -C . -f tutorial_8.make clean + @${MAKE} --no-print-directory -C . -f tutorial_9.make clean + @${MAKE} --no-print-directory -C . -f tutorial_10.make clean + @${MAKE} --no-print-directory -C . -f tutorial_11.make clean + @${MAKE} --no-print-directory -C . -f tutorial_12.make clean + @${MAKE} --no-print-directory -C . -f tutorial_13.make clean + +help: + @echo "Usage: make [config=name] [target]" + @echo "" + @echo "CONFIGURATIONS:" + @echo " debugstatic32" + @echo " releasestatic32" + @echo "" + @echo "TARGETS:" + @echo " all (default)" + @echo " clean" + @echo " behaviac" + @echo " btunittest" + @echo " btremotetest" + @echo " demo_running" + @echo " usertest" + @echo " tutorial_1" + @echo " tutorial_1_1" + @echo " tutorial_1_2" + @echo " tutorial_2" + @echo " tutorial_3" + @echo " tutorial_4" + @echo " tutorial_5" + @echo " tutorial_6" + @echo " tutorial_7" + @echo " tutorial_8" + @echo " tutorial_9" + @echo " tutorial_10" + @echo " tutorial_11" + @echo " tutorial_12" + @echo " tutorial_13" + @echo "" + @echo "For more information, see http://industriousone.com/premake/quick-start" diff --git a/src/common/object/tagobject.cpp b/src/common/object/tagobject.cpp index b98e6dc9..458401cf 100644 --- a/src/common/object/tagobject.cpp +++ b/src/common/object/tagobject.cpp @@ -89,10 +89,11 @@ namespace behaviac { for (behaviac::map::const_iterator it = members.begin(); it != members.end(); ++it) { //uint32_t memberId = it->first; const IProperty* pProperty = it->second; - - behaviac::string valueStr = pProperty->GetValueToString((behaviac::Agent*)pObject); - CIOID attrId(pProperty->Name()); - node->setAttr(attrId, valueStr.c_str()); + if (!pProperty->IsArrayItem()) { + behaviac::string valueStr = pProperty->GetValueToString((behaviac::Agent*)pObject); + CIOID attrId(pProperty->Name()); + node->setAttr(attrId, valueStr.c_str()); + } } } } diff --git a/tools/designer/BehaviacDesigner/MetaPropertyPanel.resx b/tools/designer/BehaviacDesigner/MetaPropertyPanel.resx index d9d9ac55..abc7c445 100644 --- a/tools/designer/BehaviacDesigner/MetaPropertyPanel.resx +++ b/tools/designer/BehaviacDesigner/MetaPropertyPanel.resx @@ -140,9 +140,6 @@ descGroupBox - - descGroupBox - 415, 45 @@ -150,8 +147,8 @@ NoControl - - 35 + + Popup 10 @@ -168,6 +165,9 @@ NoControl + + 0, 0 + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -177,6 +177,9 @@ MiddleLeft + + 91, 144 + isStaticCheckBox @@ -195,6 +198,9 @@ 11 + + descGroupBox + label1 @@ -207,8 +213,8 @@ NoControl - - Customized? + + 9 System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -228,8 +234,8 @@ 7 - - descGroupBox + + 13 Description: @@ -255,8 +261,8 @@ MiddleLeft - - Popup + + 91, 117 MiddleLeft @@ -273,8 +279,8 @@ descGroupBox - - 91, 15 + + 244, 65 descGroupBox @@ -306,9 +312,6 @@ descGroupBox - - arrayCheckBox - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -330,9 +333,6 @@ 35, 12 - - customizedCheckBox - 91, 69 @@ -360,6 +360,12 @@ descTextBox + + typeComboBox + + + 10 + Top, Right @@ -372,9 +378,6 @@ descGroupBox - - 9 - 14 @@ -393,9 +396,6 @@ True - - 0 - Top, Left, Right @@ -435,9 +435,6 @@ NoControl - - 91, 117 - 3 @@ -447,6 +444,9 @@ System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Default Value: @@ -471,8 +471,8 @@ Fill - - 0, 0 + + 0 8 @@ -504,8 +504,8 @@ 8 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + descGroupBox True @@ -519,11 +519,8 @@ System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 13 - - - descGroupBox + + customizedCheckBox 4 @@ -531,11 +528,11 @@ 89, 12 - - 12 + + descGroupBox - - typeComboBox + + Customized? Top, Left, Right @@ -552,14 +549,14 @@ descLabel - - 244, 65 + + 35 True - - 91, 144 + + 91, 15 descGroupBox @@ -573,11 +570,14 @@ 39 + + True + isConstCheckBox - - 10 + + 12 168, 69 @@ -597,8 +597,8 @@ Top, Left, Right - - True + + arrayCheckBox NoControl diff --git a/tools/designer/BehaviacDesigner/MetaPropertyPanel.zh-CN.resx b/tools/designer/BehaviacDesigner/MetaPropertyPanel.zh-CN.resx index 74c2e8bd..1de63465 100644 --- a/tools/designer/BehaviacDesigner/MetaPropertyPanel.zh-CN.resx +++ b/tools/designer/BehaviacDesigner/MetaPropertyPanel.zh-CN.resx @@ -214,7 +214,7 @@ 364, 20 - 433, 45 + 429, 45 54, 16 diff --git a/tools/designer/BehaviacDesigner/Properties/AssemblyInfo.cs b/tools/designer/BehaviacDesigner/Properties/AssemblyInfo.cs index 3aaad315..751af41e 100644 --- a/tools/designer/BehaviacDesigner/Properties/AssemblyInfo.cs +++ b/tools/designer/BehaviacDesigner/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("3.6.36")] -[assembly: AssemblyFileVersion("3.6.36")] +[assembly: AssemblyVersion("3.6.37")] +[assembly: AssemblyFileVersion("3.6.37")] diff --git a/tools/designer/BehaviacDesignerBase/Data/CsExporter.cs b/tools/designer/BehaviacDesignerBase/Data/CsExporter.cs index 1b19fb7e..0450798d 100644 --- a/tools/designer/BehaviacDesignerBase/Data/CsExporter.cs +++ b/tools/designer/BehaviacDesignerBase/Data/CsExporter.cs @@ -176,6 +176,29 @@ public static string GetGeneratedPropertyDefaultValue(PropertyDef prop, string t return (prop != null) ? GetGeneratedDefaultValue(prop.Type, typename, prop.DefaultValue) : null; } + public static string GetGeneratedPropertyDefaultValue(PropertyDef prop) + { + string propType = GetGeneratedNativeType(prop.Type); + string defaultValue = GetGeneratedDefaultValue(prop.Type, propType, prop.DefaultValue); + + if (!string.IsNullOrEmpty(prop.DefaultValue) && Plugin.IsArrayType(prop.Type)) + { + int index = prop.DefaultValue.IndexOf(":"); + if (index > 0) + { + Type itemType = prop.Type.GetGenericArguments()[0]; + if (!Plugin.IsArrayType(itemType) && !Plugin.IsCustomClassType(itemType)) + { + string itemsCount = prop.DefaultValue.Substring(0, index); + string items = prop.DefaultValue.Substring(index + 1).Replace("|", ", "); + defaultValue = string.Format("new {0}({1}) {{{2}}}", propType, itemsCount, items); + } + } + } + + return defaultValue; + } + public static string GetPropertyBasicName(Behaviac.Design.PropertyDef property, MethodDef.Param arrayIndexElement) { if (property != null) diff --git a/tools/designer/BehaviacDesignerBase/Data/DataType.cs b/tools/designer/BehaviacDesignerBase/Data/DataType.cs index e19edeb3..5839aa36 100644 --- a/tools/designer/BehaviacDesignerBase/Data/DataType.cs +++ b/tools/designer/BehaviacDesignerBase/Data/DataType.cs @@ -1981,17 +1981,20 @@ public string NativeItemType { get { - if (this.IsArrayElement && !string.IsNullOrEmpty(this.NativeType)) + string nativeType = this.NativeType; + + if (this.IsArrayElement && !string.IsNullOrEmpty(nativeType)) { - int startIndex = this.NativeType.IndexOf("<"); + int startIndex = nativeType.IndexOf("<"); + int endIndex = nativeType.IndexOf(">"); - if (startIndex > 0) + if (startIndex > 0 && endIndex > 0) { - return this.NativeType.Substring(startIndex + 1, this.NativeType.Length - startIndex - 2); + return nativeType.Substring(startIndex + 1, endIndex - startIndex - 1); } } - return this.NativeType; + return nativeType; } } diff --git a/tools/designer/Plugins/PluginBehaviac/DataExporters/Cpp/DataCppExporter.cs b/tools/designer/Plugins/PluginBehaviac/DataExporters/Cpp/DataCppExporter.cs index 9b0818a8..c4413189 100644 --- a/tools/designer/Plugins/PluginBehaviac/DataExporters/Cpp/DataCppExporter.cs +++ b/tools/designer/Plugins/PluginBehaviac/DataExporters/Cpp/DataCppExporter.cs @@ -213,6 +213,35 @@ public static string GetGeneratedPropertyDefaultValue(PropertyDef prop, string t return (prop != null) ? GetGeneratedDefaultValue(prop.Type, typename, prop.DefaultValue) : null; } + public static void GeneratedPropertyDefaultValue(StringWriter file, string indent, PropertyDef prop) + { + string propType = GetGeneratedNativeType(prop.Type); + string defaultValue = GetGeneratedDefaultValue(prop.Type, propType, prop.DefaultValue); + + if (defaultValue != null) + { + file.WriteLine("{0}{1} = {2};", indent, prop.BasicName, defaultValue); + } + else if (!string.IsNullOrEmpty(prop.DefaultValue) && Plugin.IsArrayType(prop.Type)) + { + int index = prop.DefaultValue.IndexOf(":"); + if (index > 0) + { + Type itemType = prop.Type.GetGenericArguments()[0]; + if (!Plugin.IsArrayType(itemType) && !Plugin.IsCustomClassType(itemType)) + { + string itemTypename = GetGeneratedNativeType(itemType); + string[] items = prop.DefaultValue.Substring(index + 1).Split('|'); + for (int i = 0; i < items.Length; ++i) + { + string defaultItemValue = GetGeneratedDefaultValue(itemType, itemTypename, items[i]); + file.WriteLine("{0}{1}.push_back({2});", indent, prop.BasicName, defaultItemValue); + } + } + } + } + } + public static string GetPropertyBasicName(Behaviac.Design.PropertyDef property, MethodDef.Param arrayIndexElement) { if (property != null) diff --git a/tools/designer/Plugins/PluginBehaviac/Exporters/ExporterCpp.cs b/tools/designer/Plugins/PluginBehaviac/Exporters/ExporterCpp.cs index 113a2c4c..f86fd65d 100644 --- a/tools/designer/Plugins/PluginBehaviac/Exporters/ExporterCpp.cs +++ b/tools/designer/Plugins/PluginBehaviac/Exporters/ExporterCpp.cs @@ -1569,7 +1569,7 @@ private void ExportDelegateMethod(StringWriter file) if (String.Compare(prop.NativeItemType, "bool", true) == 0) { - str_getter = string.Format("\n\tinline const void* Get_{1}(int index)\n\t{{\n#if _MSC_VER\n\t\treturn {2}._Getptr();\n#else\n\t\tstatic ThreadBool buffer;\n\t\tbool b = {2};\n\t\tbuffer.set(b);\n\t\treturn buffer.value();\n#endif\n\t}}", propType, propName, getValue); + str_getter = string.Format("\n\tinline const void* Get_{0}(int index)\n\t{{\n#if _MSC_VER\n\t\treturn {1}._Getptr();\n#else\n\t\tstatic ThreadBool buffer;\n\t\tbool b = {1};\n\t\tbuffer.set(b);\n\t\treturn buffer.value();\n#endif\n\t}}", propName, getValue); } else { @@ -2239,13 +2239,7 @@ private void ExportAgentCppFile(AgentType agent, string filename) { if (!prop.IsStatic && (prop.IsCustomized || !agent.IsImplemented) && !prop.IsInherited && !prop.IsPar && !prop.IsArrayElement) { - string propType = DataCppExporter.GetGeneratedNativeType(prop.Type); - string defaultValue = DataCppExporter.GetGeneratedPropertyDefaultValue(prop, propType); - - if (defaultValue != null) - { - file.WriteLine("{0}\t{1} = {2};", indent, prop.BasicName, defaultValue); - } + DataCppExporter.GeneratedPropertyDefaultValue(file, indent + "\t", prop); } } diff --git a/tools/designer/Plugins/PluginBehaviac/Exporters/ExporterCs.cs b/tools/designer/Plugins/PluginBehaviac/Exporters/ExporterCs.cs index 248ce4d7..3b9bb255 100644 --- a/tools/designer/Plugins/PluginBehaviac/Exporters/ExporterCs.cs +++ b/tools/designer/Plugins/PluginBehaviac/Exporters/ExporterCs.cs @@ -581,7 +581,8 @@ private void ExportAgentCsFile(AgentType agent, string filename, bool preview) { string staticStr = prop.IsStatic ? "static " : ""; string propType = DataCsExporter.GetGeneratedNativeType(prop.Type); - string defaultValue = DataCsExporter.GetGeneratedPropertyDefaultValue(prop, propType); + //string defaultValue = DataCsExporter.GetGeneratedPropertyDefaultValue(prop, propType); + string defaultValue = DataCsExporter.GetGeneratedPropertyDefaultValue(prop); if (defaultValue != null) { diff --git a/tutorials/CsTutorials/behaviac/runtime/Base/Meta.cs b/tutorials/CsTutorials/behaviac/runtime/Base/Meta.cs index c1cea9e3..86550b0f 100644 --- a/tutorials/CsTutorials/behaviac/runtime/Base/Meta.cs +++ b/tutorials/CsTutorials/behaviac/runtime/Base/Meta.cs @@ -339,6 +339,8 @@ public ICustomizedProperty CreateCustomizedArrayItemProperty(uint id, string nam public static string GetTypeName(string typeName) { typeName = typeName.Replace("*", ""); + //typeName = typeName.Replace("<", "<"); + //typeName = typeName.Replace(">", ">"); return typeName; } diff --git a/tutorials/CsTutorials/behaviac/runtime/version.txt b/tutorials/CsTutorials/behaviac/runtime/version.txt index 6aff5cd2..51d5fef5 100644 --- a/tutorials/CsTutorials/behaviac/runtime/version.txt +++ b/tutorials/CsTutorials/behaviac/runtime/version.txt @@ -1 +1 @@ -3.6.36 +3.6.37 diff --git a/tutorials/tutorial_1/unity/Assets/Scripts/behaviac/runtime/Base/Meta.cs b/tutorials/tutorial_1/unity/Assets/Scripts/behaviac/runtime/Base/Meta.cs index c1cea9e3..86550b0f 100644 --- a/tutorials/tutorial_1/unity/Assets/Scripts/behaviac/runtime/Base/Meta.cs +++ b/tutorials/tutorial_1/unity/Assets/Scripts/behaviac/runtime/Base/Meta.cs @@ -339,6 +339,8 @@ public ICustomizedProperty CreateCustomizedArrayItemProperty(uint id, string nam public static string GetTypeName(string typeName) { typeName = typeName.Replace("*", ""); + //typeName = typeName.Replace("<", "<"); + //typeName = typeName.Replace(">", ">"); return typeName; } diff --git a/tutorials/tutorial_1/unity/Assets/Scripts/behaviac/runtime/version.txt b/tutorials/tutorial_1/unity/Assets/Scripts/behaviac/runtime/version.txt index 6aff5cd2..51d5fef5 100644 --- a/tutorials/tutorial_1/unity/Assets/Scripts/behaviac/runtime/version.txt +++ b/tutorials/tutorial_1/unity/Assets/Scripts/behaviac/runtime/version.txt @@ -1 +1 @@ -3.6.36 +3.6.37 diff --git a/version.txt b/version.txt index 6aff5cd2..51d5fef5 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -3.6.36 +3.6.37