|
if(showPage1==false) { gameObject.Find("webpage1").GetComponent("WebViewTextureSample").enabled=false; } WebViewTextureSample is a script of a plane error: 'enabled' is not a member of 'UnityEngine.Component'. how can i solve it?
(comments are locked)
|
|
Replace the 'gameObject.Find("webpage1").GetComponent("WebViewTextureSample").enabled = false' line of code with this code: The reason why this works is because '.enabled' is a member of the custom type(Script) created in my code, and UnityEngine.Component does not have the member '.enabled' so it tosses the error.
Aug 14 '12 at 01:59 PM
TheVectorHunter
Please accept my answer and vote it up if this solved your problem. I am willing to explain why the problem occured if you want.
Aug 14 '12 at 02:01 PM
TheVectorHunter
thank you very much,it worked
Aug 16 '12 at 01:05 AM
HsmBoy
Can you accept the answer and vote it up?
Aug 16 '12 at 08:43 PM
TheVectorHunter
I'd like to ,but I don't know where to vote it up,I'm a newer i'm really sorry.
Aug 17 '12 at 06:42 AM
HsmBoy
(comments are locked)
|
|
Don't use quotes in GetComponent unless you really need to (which is almost never). Using quotes makes it return Component, which you don't want.
(comments are locked)
|
