Commit d6bd5e5
committed
Fix assert destroyed object
> 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-948841 parent 309b2f1 commit d6bd5e5
File tree
2 files changed
+25
-7
lines changed- Assets/APIExamples/Tests/Runtime/NUnit
2 files changed
+25
-7
lines changedLines changed: 24 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
935 | 935 | | |
936 | 936 | | |
937 | 937 | | |
938 | | - | |
939 | | - | |
940 | 938 | | |
941 | 939 | | |
942 | | - | |
943 | | - | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
944 | 963 | | |
945 | | - | |
946 | | - | |
| 964 | + | |
947 | 965 | | |
948 | 966 | | |
949 | 967 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
0 commit comments