Cammin / LDtkToUnity

Unity importer for the LDtk level editor
https://cammin.github.io/LDtkToUnity
MIT License
381 stars 38 forks source link

need old feature Loading a level separately #16

Closed bigtrizero closed 2 years ago

bigtrizero commented 3 years ago

222 need old feature Loading a level separately

I put the levels in multiple scenes to make one big map, and I had to load the smaller levels in each scene separately.

Cammin commented 3 years ago

If you're using before version 2.0.0, then you can select the toggles in the component to only build levels of your choice.

If you're using 2.0.0, then the imported object produces many levels without these options unfortunately. It's a bit more difficult to manage which levels are made because of an import result, so they all need to remain available in the import result.

In this scenario for your situation, a strategy you can do for each scene, is to set all of the level GameObjects as inactive except for the level you'd like to keep active. The scene overrides will remain set as long as the levels are not renamed in LDtk.

Another option could be to make a prefab for each level, and then apply this same inactive concept except within a prefab space.

Let me know if this helped 👍

Cammin commented 3 years ago

I believe I have a potential idea for this. Maybe the generated level's root can have a component where these same toggle options would be available to set on/off the levels, where it would set its hideFlags in the hierarchy and so the levels would not be visible but also inactive. I'll give this a shot, but it will be a later priority as I fix some important bugs associated with the 2.0.0 update 🙂 https://docs.unity3d.com/ScriptReference/HideFlags.HideInHierarchy.html

supertrizero commented 3 years ago

Thank you very much for your reply. I will wait for the update.

Cammin commented 3 years ago

Add option to Try and enable/disable certain levels from being included

Cammin commented 3 years ago

I've prototyped this feature to experiment with it. image

However, while playing with it, I realized that the concept behind this idea is that it just simply sets GameObjects active/inactive, which is already possible by directly setting GameObject(s) active/inactive in the GameObject's inspector.

image

I was also toying with the idea of making the objects completely invisible in the hierarchy, but my gut reaction is that it might create extra confusion.

So I think it would be a bit unnecessary to provide a redundant feature. At least for now, I'm not going to add this because this is already possible.

But I absolutely appreciate you posting the issue. I'm going to close this issue, but feel free to reopen and let me know if there is a detail that I might be missing here for why this would be added, and I'll reconsider 🙂

Cammin commented 3 years ago

After thinking it over a little more, I think that the advantage with this is that the levels are hidden from searching in the hierarchy window with the search bar, which helps reduce inactive-gameobject clutter when searching. So I will reconsider this.

Cammin commented 2 years ago

I've had another idea to get this possible: The separate level files could be considered as their own standalone imported level prefabs. (Currently the levels just serve as a way to import json data from level files)

The advantage would be that the entire project doesn't need to be dragged into the scene and then disable some of the unneeded levels. And instead, drag in the necessary levels into a scene.

I've made a card about it(https://trello.com/c/tTSOVlsf), and I'm intrigued by the idea, as it could be a nice solution to: -Reduce scene/hierarchy bloat, would feel cleaner overall -Alleviates referencing potentially unnecessary assets in memory/buildSize to load in the scene due to the inactive level gameobjects -Better modular options (modular pieces of a dungeon for example)

I'm definitely gonna try it out sometime and see if it's possible on a technical level sometime.

Cammin commented 2 years ago

Hi, I've added a feature in the new update (2.2.0) that should fulfill what you need. The separate level files can now be their own imported level hierarchies, which allows for better modularity with levels 🙂

Let me know if that works for you, otherwise, feel free to reopen the issue.

bigtrizero commented 2 years ago

oh, thank you ,  I will try it.

------------------ 原始邮件 ------------------ 发件人: "Cameron @.>; 发送时间: 2022年1月26日(星期三) 下午4:15 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [Cammin/LDtkToUnity] need old feature Loading a level separately (#16)

Hi, I've added a feature in the new update (2.2.0) that should fulfill what you need. The separate level files can now be their own imported level hierarchies, which allows for better modularity with levels �0�2

Let me know if that works for you, otherwise, feel free to reopen the issue.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>