public class LearningCurve : MonoBehaviour
{
public int currentGold = 51; void Start() { if (currentGold > 50) { Debug.Log("旦那は金持ちだね。スリに注意しなさいよ。"); } else if(currentGold < 15) { Debug.Log("ちっ。しけてやがる。"); } else { Debug.Log("ちょうどいい額だ。いただきます。"); } } // Update is called once per frame void Update() { }
}
あるunityのC#教本のスクリプト例です。"currentGold"の値を何に変更してもなぜかelseの部分が実行されてしまいます。どなたか原因わかる方回答お願いします。
回答1件
あなたの回答
tips
プレビュー