i put pragma strict so that i can verify what variables i did declare properly
for this line i get errors:
cam.currentTarget.GetComponent(Highlight).enabled=true;
this error: ‘enabled’ is not a member of ‘UnityEngine.Component’.
how to prevent this for happening?
tomvds
December 1, 2010, 3:00pm
2
(cam.currentTarget.GetComponent(Highlight) as Highlight).enabled=true;
Or:
cam.currentTarget.GetComponent.<HighLight>().enabled = true;
–Eric
if is C# u should write as eric…
but what’s that with as highlight?
That wasn’t C#, that was Javascript. C# doesn’t have #pragma strict (it’s always strict anyway), so there wouldn’t be any point mentioning C# in this topic.
–Eric