updated map selector

This commit is contained in:
PokingPines
2024-04-25 21:43:53 +02:00
parent 12df19d486
commit 6dd5933873
8 changed files with 2678 additions and 141 deletions

View File

@@ -2,19 +2,56 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using Unity.Mathematics;
public class MapSelectorScript : MonoBehaviour
{
public GameObject[] Maps;
GameObject currentMap;
quaternion currentRotation;
public GameObject CameraRotator;
public int scene;
public void change_to_track2(){
void Start()
{
DisableAllMaps();
SelectMap(0);
}
private void FixedUpdate()
{
CameraRotator.transform.eulerAngles += Vector3.up * 0.7f;
}
void DisableAllMaps()
{
foreach (GameObject map in Maps)
{
map.SetActive(false);
}
}
void SelectMap(int index)
{
DisableAllMaps();
currentMap = Maps[index];
currentMap.SetActive(true);
}
public void ChangeToTrack2()
{
scene = 2;
SelectMap(0);
}
public void change_to_track3(){
public void ChangeToTrack3()
{
scene = 3;
SelectMap(1);
}
public void selectMap(){
public void SelectMapAndLoadScene()
{
SceneManager.LoadScene(scene);
}
}