I am using Javascript and Unity iPhone to Instantiate a game piece. It works fine in the desktop version, but on the iPhone it doesn't work because it isn't the same type.
I am trying to parent this spawned object to a board, but Instantiate returns an Object and not a GameObject/transform, so I can't access the parent property. I read that a Transform is actual returned by Instantiate, but I can't typecast like you can in C#:
C#
Transform piece = (Transform)Instantiate(..); // I usually use JS, this may not be 100% correct
But this does not work in Javascript, and in standard Javascript you usually do Number(...) or .toString, etc. How would I set the parent of this spawned object using Javascript, or how would I typecast it to a transform?
But if you have #pragma strict on, then this doesn't work. Or at least, it doesn't for me. So I have the same question: how do you typecast from a more general type (Object) to a more specific type (e.g. GameObject), in order to satisfy the strict typechecking?