• Editor
  • [Editor Feature Request] Export as ".json.txt" checkbox?

Related Discussions
...

Could we have an extra checkbox in the Export window to export the json file with the (pseudo)extension ".json.txt" instead of just ".json"? (Or just an optional custom extension? although I'd hate having to foolproof an arbitrary custom extension textbox.)

Or can we already do this somehow?

It's a Unity thing. Unity itself won't take ".json" or any unrecognized file extension despite being plain text files. There's probably a Unity Script rename-on-import solution for this. But I'm not 100% on how other plugins behave.

It's just annoying to keep having to repeatedly rename the new version (which sometimes includes deleting the old version so you can rename the new version in a temporary export destination folder) every time you need to test something in-engine.

And just an extra note for the eventual built-in texturepacker, Unity also doesn't take ".atlas". So we'll probably also want a ".atlas.txt" option.

Yeah I use:

atlas.png
atlas.txt
json.txt

As the filenames personally. I'm sure it's just a tweak to let us choose the extension and filename. Once it's done once it'd be trivial to just save over it.

2 个月 后

Hey Nate!
Just curious. Is this low-hanging fruit or something harder to do and likely to break?

It's just one of those things that would make testing the animations within the game logic just SUPER easy.

No pressure (maybe). : p

Love the fancy new sliders, by the way. Also mousewheeling over transform value textboxes; really handy.

Yes, it is low hanging fruit


for Unity to fix! :p I was going to do event timeline, but if you haaave to have your export suffix... 😉 😃

Shiu gets all the credit for the new sliders. 🙂

Thanks, Nate!

Touché on Unity's side. xD
It's dumb that only .txt, .html, .xml get recognized by its manager. And that one weird extension .bytes.

4 个月 后

Quick heads-up:

I don't know when it changed, but Unity 4.3 now recognises JSON files as txt.

Thanks. I heard about this last week. But .atlas is still a problem, right?

Yeah unfortunately, though I'm dodging that by using 2DTK for the moment.

Too much to ask to let us associate file extensions ourselves I suppose.

I created a small Unity Editor Script that renames .atlas files on import to .atlas.txt. Deletes the old file if it already exists.

https://gist.github.com/talecrafter/7656531

Put that Script in an "Editor" folder in your project and it should work automatically.
I have not much experience in editor scripting, so if someone sees a flaw in this please tell us.
Tested on Windows.