Find inactive GameObject by name, tag or layer

后端 未结 3 824
滥情空心
滥情空心 2020-12-04 02:49

First, I need to deactivate a game object and then after 10 seconds, activate it, so I thought coroutines are suitable:

IEnumerator BarDeactivate(float sec)
         


        
3条回答
  •  北海茫月
    2020-12-04 03:26

    I have this issue with ARCore, Vuforia, etc. because GameObjects are not alive until they can be tracked. One way is wait for the target to be recognized and then look for the GameObjects, but if they are manually inactive the only other (uncomplicated?) way would be to manually list them and link them as a public array with the script. If your script is linked then even an inactive GameObject will be accessible.

提交回复
热议问题