unityのUIのCanvasのtextをC#スクリプトで変更したいのですが、以下のコードでは
C#
1using UnityEngine; 2using System.Collections; 3using UnityEngine.UI; 4 5public class ScoreText : MonoBehaviour { 6 int p = 10; 7 Text score; 8 9 void Start() 10 { 11 } 12 13 void Update() 14 { 15 score.text = "Score: ";<--ここがのscore.textのtextが怒られる 16 17 } 18 19} 20
'Text' does not contain a definition
というエラーが出でしまいうまくいかないのですが何が原因なのでしょうか?
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。