Comments (4)
Hi dpavon, thanks for reporting this and taking the time to track down the errant code. I've updated the source on GitHub and put up a new version to Tiled2Unity with the fix on my blog.
Good luck on your game.
from tiled2unity.
That was fast! Thanks a lot! (tested and it works)
By the way, I've got a suggestion, but I'm not sure if it's something too specific or if anyone else could benefit. As I said with the procedural generation, I need to load Resources prefabs in runtime:
In execution time, I will not know all the names of the resources, so I need to find them all somehow. I tried first with storing some kind of "index", like a cache or similar, but I don't like it and has some drawbacks.
The thing is, Unity has a method called LoadAll to do this that gives you the option to specify a relative path inside "Resources" folder, and all those prefabs inside would be loaded as Object[]. Right now in Tiled2Unity, all maps are imported either on Tiled2Unity/Prefabs, or in case this boolean is True, on "Tiled2Unity/Prefabs/Resources".
So, in short: could there be the possibility of using this "unity:resource" as a string, instead of a boolean, so that anyone could specify the folder where each map would be saved?
Example: 3 tmx maps with different unity:resource = [Forest, Lake, Mountain], and these maps would be imported on "Tiled2Unity/Resources/Forest/", "Tiled2Unity/Resources/Lake/", "Tiled2Unity/Resources/Mountain/" folders. At runtime, the developer would use LoadAll("Lake") to obtain only those needed.
Anyway, I'm not sure if using another property would be better, like "unity:resourcePath", because an empty (but existing) unity:resource="" might confuse users. I leave this open to suggestions.
Right now I'm modifying the output folder so I have all maps in a folder called "Tiled", so it's not something I would desperately need, but maybe someone could benefit of a change like this. I'm not sure if it is a minor or big change, so I'll just drop this idea over here.
Then again, great work, keep it up! You may consider this issue closed by my side.
from tiled2unity.
That's a good suggestion. I went with the unity:resourcePath approach.
You will be alerted if you use characters in your string that can't be used in a path (like '|', '<', '>', etc.).
Code and download page has been updated. Let me know if you run into any issues.
from tiled2unity.
Also, note that you don't have to use both unity:resource and unity:resourcePath together. In your case, using unity:resourcePath and having it set to a non-empty string will suffice. Having just unity:resource will resort to the old behavior. There's no harm in having both properties used as unity:resourcePath will take precedence.
from tiled2unity.
Related Issues (20)
- Error Report HOT 22
- Tileset file does not exist HOT 4
- Object reference not set as an instance while parsing layer data as Xml elements. HOT 3
- Tiled2Unity: “Object reference not set to an instance of an object” HOT 5
- After recent update: FileNotFoundException and NullReferenceException, import stalls forever
- Preview scale?
- Tiled2Unity doesn't import map with textures into Unity
- Error Finding Textures HOT 3
- Animations won't play on objects on Object Layers HOT 5
- Tiled2Unity exports only .xml and creates no prefab / Preview complains about index out of range HOT 2
- "The object you are trying to replace does not exist or is not a Prefab." HOT 6
- Unity Android and Tiled2Unity Blurred Textures Issue HOT 2
- ICustomTiledImporter not called
- Warning: Rectangle has no width/height HOT 2
- Importing map problem. Getting error missing texture HOT 4
- Issue HOT 2
- Vertex numbers in meshes changing into "Infinity" or "NaN" after export HOT 2
- After i export a map with tiled i find it on prefab HOT 1
- How do i fix these compiler errors? HOT 1
- Tiled- why does it say it cant find my files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tiled2unity.