Hey everyone ![]()
I have come across what many of us do when a project is written for Unity3D and is opened up in Unity iPhone:
From Duck’s comment on Unity Answers: Link Here
So I learned how to break down what our programmer wrote in the Unity version:
globals.GetComponent(Globals).playerScore += targetScore;
And rearrange it to work in Unity iPhone doing the following:
var global : Globals = globals.GetComponent(Globals);
global.playerScore += targetScore;
NOW the problem I am having:
Our programmer used the “GetComponent(SOMETHING).someThingHere” line in an IF STATEMENT like so:
if(globals.GetComponent(Globals).systemOn)
Using the pattern from what I learned above I tried to fix the IF STATEMENT by doing this:
if(var global : Globals = globals.GetComponent(Globals);
global.systemOn;)
When I did that, I got the following Unity Error:
I am not sure how to adjust the dynamically changed variable here to a strict one when it is in an IF statement that is not expecting that code.
I am sure I am missing something, as I am very new to all of this, so I accept any criticism. Appreciate the time! ![]()