Skip to content

Commit

Permalink
fix: Don't use reflection to check docking status in Unity2022
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuryg committed Dec 12, 2023
1 parent 44ca80c commit 8deb878
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ public bool IsDocked
{
get
{
#if UNITY_2019
BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Instance;
MethodInfo method = GetType().GetProperty( "docked", flags ).GetGetMethod( true );
return (bool)method.Invoke( this, null );
#else
return docked;
#endif
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ public bool IsDocked
{
get
{
#if UNITY_2019
BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Instance;
MethodInfo method = GetType().GetProperty( "docked", flags ).GetGetMethod( true );
return (bool)method.Invoke( this, null );
#else
return docked;
#endif
}
}

Expand Down

0 comments on commit 8deb878

Please sign in to comment.