Skip to content

Update reflection against VRC SDK to instead use assembly definition version defines #226

Description

@jonomf

Hi! I merged your PR to add Av3Emulator v3.4.13 to vpm-listing-curated yesterday. Thank you!

I noticed in the diff that you're reflecting on public fields in the new VRCRaycast component. It looks like this is to support users with older SDK versions, so this code will quietly return if the raycast types don't exist. Nice; but it's tripping my reflection alarm! If we make field changes in the future, your code would break.

I'd like to recommend that you remove the reflection, and instead use the 'Version Defines' mechanism of assembly definition files: on lyuma.av3emulator.asmdef, you should be able to add a custom compiler flag for VRC_RAYCAST like so:
Image
and then access VRCRaycast's public fields directly, within a #if VRC_RAYCAST define.

Let me know if I've missed anything that invalidates this request. Thank you!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions