C# Automatic references assignment - making references null -
During the detection of objects, good practice of Unity 3D in C # scripting environment (operated under mono) is destroyed All references that point to the object are automatically empty:
GameAbject Rif 1 = (Game Object Instantiate) (OBJ); Game object ref2 = ref1; If (ref1! = Null) debug Log ("ref1 is not zero"); DestroyImmediate (ref1); If (ref1 == faucet) debug Log ("ref1 is null"); If (ref2 == faucet) debug Log ("ref2 is null");
Output:
ref1 is not empty ref1 is empty ref2 zero
How about receiving Also consider this?
Thanks
It is possible that the Unity 3D (AB) operator overloading Some kind of internal flag that has been deleted from bool
to deleted
to true
on DestroyImmediate
. Function then null
yields true
. Equality test against
Comments
Post a Comment