using UnityEngine; using System.Collections; using System.Collections.Generic; public class TrailerController : MonoBehaviour { public List Tracks; void Start() { foreach (var track in Tracks) { track.SetActive(false); } var random = Random.Range(0, Tracks.Count); Tracks[random].SetActive(true); } void OnEnable() { foreach (var track in Tracks) { track.SetActive(false); } var random1 = Random.Range(0, Tracks.Count); var random2 = Random.Range(0, Tracks.Count); Tracks[random1].SetActive(true); Tracks[random2].SetActive(true); } }