-
-
Notifications
You must be signed in to change notification settings - Fork 34
Implement utility to check for used render pipeline #766
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
|
||
switch (renderPipelineAsset.GetType().Name) | ||
{ | ||
case urpAssetTypeName: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we can use pattern matching for the types instead of using the string name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actual types are only available if the URP / HDRP package is installed and this check needs to work even when no render pipeline package is in use. So string is all we got.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FejZa do you know if those packages define symbols for the features?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No they don't. Freya Holmér put a lot of thoughts into this and this is pretty much what she came up with in the end. It's not perfect but I don't think currently there is any better way to check this.
XRTK-Core/Packages/com.xrtk.core/Runtime/Definitions/Utilities/RenderPipeline.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Did a bit of poking around and agree, it's the simplest solution since Unity doesn't provide an internal API
* Implement utility to check for used render pipeline * Fix docs
XRTK - Mixed Reality Toolkit Pull Request
Overview
Adds a small utility class to detect the render pipeline currently in use.