C#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4 5using UnityEngine.UI; // 追加しましょう 6 7public class fauna_script : MonoBehaviour 8{ 9 10 int i; 11 public GameObject score_object = null; // Textオブジェクト 12 13 // 初期化 14 private int Score; //得点の変数 15 public Text ScoreText; //得点の文字の変数 16 17 // Start is called before the first frame update 18 void Start() 19 { 20 Score = 200; //得点を0にする 21 } 22 void Update() 23 { 24 ScoreText.text = "fauna:" + Score.ToString(); //ScoreTextの文字をScore:Scoreの値にする 25 26 27 if (Score == 5) ; 28 { 29 Debug.Log("これが出たら成功"); 30 } 31 32 } 33}
この様にコードを書いたんですが、コンソールウィンドウには
これが出たら成功
と出てしまいます
そのメッセージの条件は Score == 5
のはずなのに、Scoreが200なのにこの様な
メッセージが出てしまいます
何方か対処方法を教えて下さいm(_ _)m
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2020/10/06 00:44