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

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -