Jamie Greunbaum 6cb81308f7 - Added functional map points, and a mostly-functional map marker.
- Added the missing Top Grunge portrait and intro theme.
- Added In Jail and Video Music Clue sound effects.
2025-06-21 23:39:32 -04:00

62 lines
1.5 KiB
C#

using System;
using System.Linq;
using UdonSharp;
using UnityEngine;
using VRC.SDK3.Data;
using VRC.SDKBase;
using VRC.Udon;
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
public class FloorMap : UdonSharpBehaviour
{
public FloorMapCountry[] Countries;
private string[] _ChosenCountries = new string[MAX_SELECTED_COUNTRIES];
private string[] _ChosenCities = new string[MAX_SELECTED_COUNTRIES];
private int _CurrentCountry = 0;
private const int MAX_SELECTED_COUNTRIES = 13;
void Start()
{
_CurrentCountry = 0;
UnityEngine.Random.InitState(Networking.GetServerTimeInMilliseconds());
FloorMapCountry[] SelectedCountries = new FloorMapCountry[MAX_SELECTED_COUNTRIES];
for (int i = 0; i < MAX_SELECTED_COUNTRIES; i++)
{
int NewPulledIndex = UnityEngine.Random.Range(0, Countries.Length);
while (Countries[NewPulledIndex].gameObject.activeSelf)
{
NewPulledIndex = UnityEngine.Random.Range(0, Countries.Length);
}
FloorMapCountry Country = Countries[NewPulledIndex];
Country.gameObject.SetActive(true);
SelectedCountries[i] = Countries[NewPulledIndex];
FloorMapLocation Location = Country.Locations[UnityEngine.Random.Range(0, Country.Locations.Length)];
Location.gameObject.SetActive(true);
_ChosenCountries[i] = Location.Country;
_ChosenCities[i] = Location.City;
}
}
public string GetCurrentCountry()
{
return _ChosenCountries[_CurrentCountry];
}
public string GetCurrentCity()
{
return _ChosenCities[_CurrentCountry];
}
}