Skip to content

Conversation

nowsprinting
Copy link
Owner

In the Editor, Unity overrides null checks for destroyed GameObjects to provide additional debugging visibility, meaning a destroyed GameObject reference is not null but will evaluate to false when cast to a bool. This is specific to the Editor's debugging environment.

In the Player, Unity optimizes GameObject management for performance and does not retain references to destroyed GameObjects in the same way. Once destroyed, the GameObject behaves like a standard object and becomes null.

https://unity3d.atlassian.net/servicedesk/customer/portal/2/IN-94884

> In the Editor, Unity overrides null checks for destroyed GameObjects to provide additional debugging visibility, meaning a destroyed GameObject reference is not null but will evaluate to false when cast to a bool. This is specific to the Editor's debugging environment.
>
> In the Player, Unity optimizes GameObject management for performance and does not retain references to destroyed GameObjects in the same way. Once destroyed, the GameObject behaves like a standard object and becomes null.

https://unity3d.atlassian.net/servicedesk/customer/portal/2/IN-94884
Copy link

Code Metrics Report

master (309b2f1) #35 (5d32aa8) +/-
Coverage 37.0% 37.0% 0.0%
Code to Test Ratio 1:3.2 1:3.2 +0.0
Test Execution Time 4m41s 4m41s 0s
Details
  |                     | master (309b2f1) | #35 (5d32aa8) | +/-  |
  |---------------------|------------------|---------------|------|
  | Coverage            |            37.0% |         37.0% | 0.0% |
  |   Files             |               30 |            30 |    0 |
  |   Lines             |              507 |           507 |    0 |
  |   Covered           |              188 |           188 |    0 |
+ | Code to Test Ratio  |            1:3.2 |         1:3.2 | +0.0 |
  |   Code              |             1381 |          1381 |    0 |
+ |   Test              |             4486 |          4501 |  +15 |
  | Test Execution Time |            4m41s |         4m41s |   0s |

Reported by octocov

@nowsprinting nowsprinting merged commit 358834e into master Feb 10, 2025
18 checks passed
@nowsprinting nowsprinting deleted the fix/assert_destroyed branch February 10, 2025 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant