How to find class name by its ID used by UnityPlayer.
There is a list of known class IDs in Unity docs. But I have got an error on Nintendo Switch platform: Could not produce class with ID 328. The above list has no record about 328. And this is not MonoBehaviour, because the doc says all MonoBehaviours are 114. So, I guess it is some internall engine's class. But I can't find its name to blacklist it from stripping. So, maybe someone knows a way to go somewhere in Unity engine or maybe in some YAML file in project tree and get this class name by its ID? Or maybe someone have access to Unity engine sources and can find it there?
Answer by FIFTYTWO · Mar 06, 2018 at 09:37 AM
I've found it! It was UnityEngine.Video.VideoPlayer It's weird that it is not presented in the list.
Do you mean how did I find 328 to VideoPlayer mapping? Actualy it was in YA$$anonymous$$L file, but it was in prefab in my case. So, I think the general way to find is to look for !u!328 in asset files (scenes, prefabs, assets), or just make text search for !u!328 by all files inside Assets folder. Replace 328 with your ID. I found it as the following: --- !u!328 &1425794687 VideoPlayer: And what I made with that: I moved the prefab with VideoPlayer to Resources to load it depending on platform. I implemented Switch player separately as well. I made wrappers for both of them with common interface, so my code uses them seamlessly after platform depending video player resource loading.
Your idea works, I found 328 in .unity file. Thanks to that I know what was wrong in my case. Thank you very much.