(スクリプト)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RandomStartPos : MonoBehaviour
{
public GameObject red;
public GameObject blue;
private int redNum;
private int blueNum;
public GameObject[] pos;
void Start()
{
redNum = Random.Range(0, pos.Length);
blueNum = Random.Range(0, pos.Length);
red.transform.position = pos[redNum].transform.position;
while(redNum == blueNum)
{
blueNum = Random.Range(0, pos.Length);
print("実行!");
}
blue.transform.position = pos[blueNum].transform.position;
}
}