gelic-idealab / komodo-unity

Unity VR client for the Komodo XR platform
5 stars 3 forks source link

Tags are incomplete in projects using Komodo package #67

Open parseccentric opened 3 years ago

parseccentric commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Updates:

parseccentric commented 3 years ago

Draw and Interactable are included as of https://github.com/gelic-idealab/komodo-unity/pull/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.