Some devs I've worked with have wrongly concluded that the PressableButtonHoloLens2.prefab and similarly named classes and prefabs work _only_ on HoloLens2. This naming scheme is confusing people.
Just rename them to remove the HoloLens2 portion of the name.
PressableButtonHololens2.cs provides a strict superset of functionality given by PressableButton.cs. Why even have both classes? Also the functionality that it gives is really just to add a compressable cube and an icon/text object. These are not really HL2-specific.
Move all the functionality of PressableButtonHololens2.cs into PressableButton.cs. Make PressableButtonHololens2 an empty class which derives from PressableButton and has an [Obsolete] attribute.
Renaming things in Unity has some quirks. For users consuming this via a submodule or file copy, if you move/rename the meta files properly, Unity will automatically rewire things for you and it will work.
For users consuming via a nuget package, upgrade scripts are required because the meta files are not present in the nuget package. I've done this with .cs files before but have not done it with .prefab files. So I'm not sure of the feasibility.
The intention was to provide a generic pressable button and HoloLens2 'style' button that has additional components such as moving icon & text or front plate/highlight plate.
@julenka for any additional context.
Should we rename this to "HoloLens2StyleButton"?
PressableButtonHoloLens2Style would be my (verbose) suggestion.
PressableButtonHoloLens2Style would be my (verbose) suggestion.
Button should be at the end of the name for consistent naming convention.
One thing to consider is how a name change may impact existing applications. If it is simply the prefab name(s) changing, Unity's .meta files should properly handle the change _provided_ the files are renamed in Unity.
Also, thanks @AdamMitchell-ms for mentioning adding [Obsolete] to the legacy class names
This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.
Most helpful comment
Should we rename this to "HoloLens2StyleButton"?