teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

ソースコードの変更

2018/06/30 12:17

投稿

qpalzmoknijb
qpalzmoknijb

スコア13

title CHANGED
File without changes
body CHANGED
@@ -17,12 +17,13 @@
17
17
  public GameObject True1;
18
18
 
19
19
  void Start(){
20
- True1.DigitalOutput = false;
20
+ True1.GetComponent<DigitalOutput>().enabled = false;
21
21
  }
22
22
  ```
23
23
  ```
24
24
  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?
25
25
  ```
26
26
  ```
27
- Assets/Monobit Unity Networking/Samples/Scripts/SimpleChat/SimpleChat.cs(32,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?
27
+ 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?
28
+
28
29
  ```

1

画像の追加

2018/06/30 12:16

投稿

qpalzmoknijb
qpalzmoknijb

スコア13

title CHANGED
File without changes
body CHANGED
@@ -5,10 +5,15 @@
5
5
  os windows10
6
6
  Unity 2017.4.1f1
7
7
 
8
+ ![True1のインスペクター](3e0d85bbe566f6bddaa9aa35825822e6.png)
9
+ ![ヒエラルキー](aec9b6a5a8a2f5bce4c426bc0ac2cee8.png)
10
+ ![イメージ説明](8c32b1dee159681b60f2681c6d3c0287.png)
11
+
8
12
  ###試したこと
9
13
  下記のように実行したところ、エラーが発生
10
14
  なお、無効化したいスクリプトはTrue1というオブジェクトにアタッチされたDigitalOutputというスクリプトです。
11
15
  ```C#
16
+ //SceneScriptにアタッチされている
12
17
  public GameObject True1;
13
18
 
14
19
  void Start(){