###困ったこと
public GameObjectでゲームオブジェクトを取得したが、取得したオブジェクトにアタッチされたスクリプトの無効化の方法がわからない。
###環境
os windows10
Unity 2017.4.1f1
###試したこと
下記のように実行したところ、エラーが発生
なお、無効化したいスクリプトはTrue1というオブジェクトにアタッチされたDigitalOutputというスクリプトです。
C#
1//SceneScriptにアタッチされている 2 public GameObject True1; 3 4 void Start(){ 5 True1.GetComponent<DigitalOutput>().enabled = false; 6 }
Assets/enabletester.cs(12,9): error CS1061: Type `UnityEngine.GameObject' does not contain a definition for `DigitalOutput' and no extension method `DigitalOutput' of type `UnityEngine.GameObject' could be found. Are you missing an assembly reference?
Assets/Monobit Unity Networking/Samples/Scripts/SimpleChat/SimpleChat.cs(32,22): error CS0246: The type or namespace name `DigitalOutput' could not be found. Are you missing `Ardunity' using directive?
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/06/30 12:17