r2mods/ilspy_dump/ror2_csproj/RoR2/PickRandomObjectOnAwake.cs

18 lines
316 B
C#

using UnityEngine;
namespace RoR2;
public class PickRandomObjectOnAwake : MonoBehaviour
{
public GameObject[] ObjectsToSelect;
private void Awake()
{
int num = Random.Range(0, ObjectsToSelect.Length);
for (int i = 0; i < ObjectsToSelect.Length; i++)
{
ObjectsToSelect[i].SetActive(i == num);
}
}
}