Gothic-UnZENity-Project / Gothic-UnZENity

Fan project recreating Piranha Bytes' evergreens Gothic I and Gothic II in Unity Engine. Currently focussing on VR.
GNU General Public License v3.0
6 stars 1 forks source link

Update HVRFocus - Dynamically attach it to all meshes of an object #68

Open JaXt0r opened 3 days ago

JaXt0r commented 3 days ago

Background

Right now, we attach our HVRFocus.cs component and the neccessary HVRGrabbable component onto Prefabs via Regex lookup (@see https://github.com/Gothic-UnZENity-Project/Gothic-UnZENity/issues/67). The problem is, that this logic isn't fully fitting dynamic G1 asset needs.

Example

A water pipe is of type oCMobInter and has the following complex GO structure: Image

Another oCMobInter has this structure: Image

Nevertheless, the oCMobInter.prefab looks like this to ensure most of this VOB type is handled right now (Wildcard will not match for water pipe): Image

As both share the same prefab based on type (oCMobInter.prefab), we can't easily distinguish their needs.

Solution idea

If we have VOB types, which can't be fully handled via Prefab-regex logic, we can overcome this by doing the following:

Image