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

Layout Json File Not Converted Correctly #13

Open
amirkhan184 opened this issue Jul 9, 2023 · 0 comments
Open

Layout Json File Not Converted Correctly #13

amirkhan184 opened this issue Jul 9, 2023 · 0 comments

Comments

@amirkhan184
Copy link

amirkhan184 commented Jul 9, 2023

Hi. First i want to thank you for developing this awesome library 😃
there's a problem when plugin unity side try to read layout json file. the problem is that if one of the properties in json file is decimal number then the MiniJson (the code that plugin use to handle json) will return 0.
for example:
{"info":{"version":"0.6.1","canvas":{"image":{"w":614,"h":841},"size":{"w":614,"h":841},"base":{"x":307,"y":420.5}}},"root":{"type":"Root","name":"Spaceship","elements":[{"type":"Image","image":"spaceship-puzzle20layer","x":0,"y":92,"w":614,"h":748,"opacity":100,"name":"Spaceship Puzzle Layer"},{"type":"Image","image":"part-1","x":11,"y":0,"w":403,"h":402,"opacity":100,"name":"Part 1"},{"type":"Image","image":"part-2","x":261,"y":142,"w":342,"h":253,"opacity":100,"name":"Part 2"},{"type":"Image","image":"part-3","x":3,"y":373,"w":263,"h":223,"opacity":100,"name":"Part 3"},{"type":"Image","image":"part-4","x":142,"y":370,"w":469,"h":251,"opacity":100,"name":"Part 4"},{"type":"Image","image":"part-5","x":26,"y":609,"w":562,"h":229,"opacity":100,"name":"Part 5"}]}}

this is my layout json and there is a decimal number in json (420.5) the vector2 that plugin try to get from this json will be (307,0) instead of (307,420.5)

i changed json plugin to Newtonsoft and it worked well for me

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

No branches or pull requests

1 participant