In the scripting manual it specifies that `if(rigidbody)` is the same as `if(rigidbody!=null)`. Yet I'm getting different behaviour depending on which syntax I use (in UnityScript). When I use the latter my game proceeds as normal, but when I stop play in the Unity Editor, I get the errors:
!IsDestroying()
UnityEngine.GameObject:set_active(Boolean)
!gameObject.IsActive()
Assert in file: /Applications/.../Misc/GameObjectUtility.cpp at line: 773
However when I use the former syntax the error disappears. Am I misunderstanding the syntax of these two commands? My script looks like:
#pragma strict
static function SetActive( inDict : Dictionary.<String,GameObject>, newState : boolean )
{
for(var cObj in inDict.Values)
if(cObj!=null)
(cObj as GameObject).active = newState;
}