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

質問編集履歴

1

スクリプトの上下に"```"を追記

2020/06/22 02:13

投稿

RIPmomiji
RIPmomiji

スコア0

title CHANGED
File without changes
body CHANGED
@@ -7,9 +7,8 @@
7
7
  ### 該当のソースコード
8
8
 
9
9
  C#
10
-
11
10
  ButtonController.cs //ボタンを押すとカウントするスクリプト
12
-
11
+ ```
13
12
  using System;
14
13
  using System.Collections;
15
14
  using System.Collections.Generic;
@@ -79,10 +78,11 @@
79
78
 
80
79
 
81
80
  }
81
+ ```
82
82
 
83
83
 
84
-
85
84
  WRManager.cs //textに文字を反映するスクリプト
85
+ ```
86
86
  using System.Collections;
87
87
  using System.Collections.Generic;
88
88
  using UnityEngine;
@@ -115,10 +115,10 @@
115
115
 
116
116
  }
117
117
  }
118
+ ```
118
119
 
119
120
 
120
121
 
121
-
122
122
  ### 試したこと
123
123
  [リンク](https://www.sejuku.net/blog/55029)を参考に
124
124
  上記のスクリプトでUnityのUITextに000000を反映することはできました。
@@ -129,7 +129,7 @@
129
129
 
130
130
  その際に見様見真似で書いたスクリプト
131
131
 
132
-
132
+ ```
133
133
  using System.Collections;
134
134
  using System.Collections.Generic;
135
135
  using UnityEngine;
@@ -165,7 +165,7 @@
165
165
 
166
166
  }
167
167
  }
168
-
168
+ ```
169
169
  このスクリプトだと実行時に
170
170
  NullReferenceException: Object reference not set to an instance of an object
171
171
  WRManager.Update () (at Assets/WRManager.cs:32)