I have a bit of a stumper for strict typecasting. In base Unity this works as the type is not relevant. I have a controller script and an advanced version that inherits it. BasicScript is on most objects, but Advanced is needed for a few objects.
I have a function that gets the script on the object using GetComponent. If one is missing it tries for the other. So if there is no direct basic script, it looks for advanced and returns it.
In declaring explicitly, I end up with it forcing all of them to “BasicScript” even though some should be AdvancedScript". Is there any reasonable way to have a variable in the iPhone setup that can get more than one type of object/script? The strict declaration is killing the code. If it would run as is it would work fine, but I keep getting “funcitonName” is not a member of type “Object”, or I get Null if I explicitly set the type.
Ideas?
Thanks.
-Chuck