Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR] Export Complex Custom Type as Json String #226

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

yuwenhuisama
Copy link

@yuwenhuisama yuwenhuisama commented Oct 16, 2022

This PR is related to #225

We found there are some bugs when we export custom properties with SuperTiled2Unity.CustomProperty where the original code cannot handle complex custom property (with nested structures).

This PR has fixed this bug by exporting all the property as json string, for example:

Custom property like this:

image

which will be exported in Unity SuperCustomProperties:
image

PlaintInt
- Name: PlaintInt
- Type: int
- Value: {"type":"int","value":"0"}

TestProperty
- Name: TestProperty
- Type: TestClass
- Value: {{
    "type": "class",
    "realType": "TestClass",
    "Field1": {
        "type": "int",
        "realType": "int",
        "value": "0"
    },
    "Field2": {
        "type": "int",
        "realType": "int",
        "value": "0"
    },
    "Field3": {
        "type": "string",
        "value": "new String"
    },
    "SubClass": {
        "realType": "TestSubClass",
        "type": "class",
        "value": {
            "Value": {
                "type": "string",
                "realType": "string",
                "value": "the value"
            }
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant