Map selector

This commit is contained in:
PokingPines
2024-04-25 12:57:44 +02:00
parent 31d431cd34
commit 06756d418a
25 changed files with 1188 additions and 43 deletions

View File

@@ -7,11 +7,11 @@ public class MapSelectorScript : MonoBehaviour
{
public int scene;
public void change_to_track2(){
scene = 2;
scene = 1;
}
public void change_to_track3(){
scene = 3;
scene = 2;
}
public void selectMap(){

View File

@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SkyboxLoader : MonoBehaviour
{
public Material skyboxDay;
public Material skyboxNight;
string skyboxToLoad;
void Awake()
{
skyboxToLoad = GameObject.Find("SkyboxManager").GetComponent<TimeOfDay>().skyboxMaterial;
Debug.Log("Skybox: " + skyboxToLoad);
if (skyboxToLoad == "Day")
{
RenderSettings.skybox = skyboxDay;
}
else
{
RenderSettings.skybox = skyboxNight;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 56ccdf5df0a83eb4091e7eeb634e5d5a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class TimeOfDay : MonoBehaviour
{
public string skyboxMaterial;
public static TimeOfDay Instance;
public TextMeshProUGUI MainText;
public void ChangeToDayTime()
{
skyboxMaterial = "Day";
}
public void ChangeToNightTime()
{
skyboxMaterial = "Night";
}
private void Awake()
{
Instance = this;
DontDestroyOnLoad(gameObject);
}
private void Update()
{
MainText.text = "Selected time of day: \n" + skyboxMaterial;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ab14f81283cca7e4c91a272a9773809d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: