Can I get the GUID and LocalFileId for a abstract class like Graphic?
Hi all,
I can get GUID and LocalFileId for an asset by this function.
AssetDatabase.TryGetGUIDAndLocalFileIdentifier
And I notice any monobehaviour should have identical GUID. And I know Image and RawImage both inherits from Graphic, which is an abstract class. I wonder if I could get Graphic's identical GUID and LocalFileId.
It's hard to understand why I want this but I will explain.
Let's say we have a Animation Controller and adjust some Color modifier for certain Image. Now I want to apply it to BOTH Image AND RawImage, by simply attach it to Image or RawImage.
In the raw text of the AnimationController file (.controller file), there should be
script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} // this is an Image
OR
script: {fileID: -98529514, guid: f70555f144d8491a825f0804e09c671c, type: 3} // this is an RawImage
So this controller controls either Image or RawImage's color by setting to different GUIDs. However Color is a member of their common abstract parent Graphic. So I should not have to specify to detail.
By replacing the above lines one to another, I get control of Image OR RawImage solely. What I want to control either of them for a single controller. So I believe that if I can replace it to
script: {fileID: FileIdOfGraphic, guid: GUIDOfGraphic, type: 3}
Then this controller should be working well with both Image and RawImage. But I have no idea if I could get fileID or guild for their abstract parent Graphic.
Any ideas to make this working without copy animations?