diff --git a/src/Inspectors/GameObjectInspector.cs b/src/Inspectors/GameObjectInspector.cs index 8116deb..dd1442b 100644 --- a/src/Inspectors/GameObjectInspector.cs +++ b/src/Inspectors/GameObjectInspector.cs @@ -11,7 +11,7 @@ namespace UnityExplorer.Inspectors { public class GameObjectInspector : InspectorBase { - public new GameObject Target => base.Target as GameObject; + public new GameObject Target => base.Target.TryCast(); public GameObject Content; @@ -31,7 +31,7 @@ namespace UnityExplorer.Inspectors { base.OnBorrowedFromPool(target); - base.Target = target as GameObject; + base.Target = target.TryCast(); Controls.UpdateGameObjectInfo(true, true); Controls.TransformControl.UpdateTransformControlValues(true); diff --git a/src/Inspectors/InspectorManager.cs b/src/Inspectors/InspectorManager.cs index 9bd9fe4..fe112eb 100644 --- a/src/Inspectors/InspectorManager.cs +++ b/src/Inspectors/InspectorManager.cs @@ -27,7 +27,7 @@ namespace UnityExplorer if (TryFocusActiveInspector(obj)) return; - if (obj is GameObject) + if (obj.TryCast() is not null) CreateInspector(obj); else CreateInspector(obj, false, parent);