updated map selector
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user