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);
|
||||
}
|
||||
}
|
||||
|
||||
19
Assets/Scripts/map selector script/VisualizeMap.cs
Normal file
19
Assets/Scripts/map selector script/VisualizeMap.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.Mathematics;
|
||||
using UnityEngine;
|
||||
|
||||
public class VisualizeMap : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/map selector script/VisualizeMap.cs.meta
Normal file
11
Assets/Scripts/map selector script/VisualizeMap.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac4187952aaaa8b488bdebaae221db71
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user