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

Tags are incomplete in projects using Komodo package #67

Open
parseccentric opened this issue May 18, 2021 · 3 comments
Open

Tags are incomplete in projects using Komodo package #67

parseccentric opened this issue May 18, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@parseccentric
Copy link
Contributor

parseccentric commented May 18, 2021

When you use Komodo as a package at the moment, the tag list is incomplete. I suspect this is because Unity detects which prefabs have tag strings on them and auto-generates those tags.

Example (MenuUI.prefab):


GameObject:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  serializedVersion: 6
  m_Component:
  - component: {fileID: 7837119552983968088}
  - component: {fileID: 7946481211550140238}
  - component: {fileID: 7946847445959112422}
  m_Layer: 5
  m_Name: List
  m_TagString: UIInteractable
                       ^
  m_Icon: {fileID: 0}
  m_NavMeshLayer: 0
  m_StaticEditorFlags: 0
  m_IsActive: 1
--- !u!224 &7837119552983968088

So in theory we could add a prefab to gelic-idealab/komodo-unity to force projects that use Komodo to generate those tags. As in, the prefab looks like this:

TagGenerator
    Interactable
    UIInteractable
    UserIgnore
    HandL
    HandR
    Hands
    ...

And if you click on each item, it is tagged with its own name.

But it might be better to write up a tag manager and add Komodo tags to a user's project. We should "namespace" the tags if we can too -- UIInteractable -> KomodoUIInteractable, or something like that.

https://answers.unity.com/questions/33597/is-it-possible-to-create-a-tag-programmatically.html

@parseccentric
Copy link
Contributor Author

I just pushed a couple commits that temporarily fix this problem. Right now, I use this strategy:

Use TagList.cs to keep track of all literal string representations of tags.

Use a prefab, Tags, which has child objects representing each tag. Each of those is tagged with itself. This is now in the main scene, so when a user opens the main scene, Unity detects these and adds the tags.

@parseccentric
Copy link
Contributor Author

Updates:

  • We should only manually recreate objects with tags for tags we expect to be used on more than one object, and tags we don't already have on an object.
  • That means tags like MenuUI should not be created in this prefab.
  • That means missing tags like Draw and Interactable should be created in this prefab.
  • David suggests using ECS tags, which would bypass the one-tag-per-singleton problem.

@parseccentric
Copy link
Contributor Author

Draw and Interactable are included as of #69.

However, PlayerSpawnCenter will still need to be manually added via the Unity Tag Manager. The problem is that any empty tagged PlayerSpawnCenter can be detected by the Komodo setup code, which may lead to unexpected spawn locations.

@parseccentric parseccentric added bug Something isn't working and removed develop-branch labels Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant