回答ありがとうございます。
>>355自分がやりたいのはこれです。
for文を使ってやってみたのですがaの値が同じになってしまいます。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class practice : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
int a = Random.Range(1, 11);
int b = 0;
for (int i = 0; i < 3; i ++)
{
b += a;
}
Debug.Log(a);
Debug.Log(b);
}
}
これだとコンソールに3,9や5,15, 10,30と表示されます。
b = a + a + aも駄目でした。
【ゲームエンジン】Unityなんでも質問スレpart9
■ このスレッドは過去ログ倉庫に格納されています
358名前は開発中のものです。
2023/01/18(水) 01:17:56.54ID:gb9xw2nh■ このスレッドは過去ログ倉庫に格納されています
