SuperTiled2Unity icon indicating copy to clipboard operation
SuperTiled2Unity copied to clipboard

Predefined custom class does not export properly

Open wakinpang opened this issue 3 years ago • 5 comments

we defined a custom class like this image and use it as property, we found that there is no hierarchy relationship between class and members, they exported to same layer like this image member and class are in the same level, and sometimes members are missing(there is no flag member in above pic) is this a bug or just by design?

wakinpang avatar Oct 10 '22 17:10 wakinpang

Hi there, @wakinpang. These custom classes were not a feature when I first put ST2U together and I didn't know about them until you posted this issue.

I'll study this some more and work on implementing it into my tool. Thanks for letting me know.

Seanba avatar Oct 12 '22 04:10 Seanba

Hello @Seanba , Thanks for replying, we are trying to resolve this by adding all class's data and structure into CustomeProperty 's m_Value with json format. so when we export a class property, there is only one custom property represents the class, the member and data are in the Value box

wakinpang avatar Oct 15 '22 07:10 wakinpang

@wakinpang can you send me your exported Object Types XML file? It will help me in testing. Thanks.

Seanba avatar Oct 15 '22 17:10 Seanba

<?xml version="1.0" encoding="UTF-8"?>
<objecttypes>
 <objecttype name="Script" color="#aa0000">
  <property name="CorrespondType" type="int" propertytype="TriggerType" default="0"/>
  <property name="ScriptFile" type="file" default=""/>
 </objecttype>
 <objecttype name="Test" color="#00557f">
  <property name="flag" type="int" propertytype="TriggerType" default="0"/>
  <property name="type" type="int" propertytype="ObjectType" default="0"/>
 </objecttype>
</objecttypes>

@Seanba Of course, it's simple, the TriggerType and ObjectType are both enum.

wakinpang avatar Oct 16 '22 08:10 wakinpang

Hi @Seanba , we commit a PR to fix this bug, but it seems like a breaking change, pls have a review. #226

yuwenhuisama avatar Oct 16 '22 11:10 yuwenhuisama