Map selector done

This commit is contained in:
PokingPines
2024-04-26 10:07:16 +02:00
parent 8d3bee48dd
commit 50c949f0cb
10 changed files with 158 additions and 20 deletions

View File

@@ -0,0 +1 @@
{"count":1,"self":21.5131744,"total":23.13593,"children":{"InitializeActuators":{"count":8,"self":0.0025478,"total":0.0025478,"children":null},"InitializeSensors":{"count":8,"self":0.0029984,"total":0.0029984,"children":null},"AgentSendState":{"count":909,"self":0.13680989999999998,"total":0.1972582,"children":{"CollectObservations":{"count":1456,"self":0.031240499999999997,"total":0.031240499999999997,"children":null},"WriteActionMask":{"count":1456,"self":0.0027826,"total":0.0027826,"children":null},"RequestDecision":{"count":1456,"self":0.0264252,"total":0.0264252,"children":null}}},"DecideAction":{"count":909,"self":1.2634709,"total":1.28315,"children":{"RayPerceptionSensor.Perceive":{"count":2912,"self":0.019679099999999998,"total":0.019679099999999998,"children":null}}},"AgentAct":{"count":909,"self":0.1368018,"total":0.1368018,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714118759","unity_version":"2022.3.11f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.11f1\\Editor\\Unity.exe -projectpath C:\\Users\\hassa\\OneDrive\\Skrivebord\\alt pro\\Unity stuff\\Unity ting\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-hassa -hubSessionId f8278c6f-053c-492d-a479-00a9dbf73437 -accessToken 1rPuSgTkgUUOXMaGthhixd2ZEngLQ-H31CETUrEqtzM005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"ForestRacetrack","end_time_seconds":"1714118782"}}

View File

@@ -1 +1 @@
{"count":1,"self":29.785408,"total":29.9198213,"children":{"InitializeActuators":{"count":1,"self":0.00099969999999999985,"total":0.00099969999999999985,"children":null},"InitializeSensors":{"count":1,"self":0.0025277999999999998,"total":0.0025277999999999998,"children":null},"AgentSendState":{"count":521,"self":0.0782659,"total":0.130885,"children":{"CollectObservations":{"count":521,"self":0.052619099999999995,"total":0.052619099999999995,"children":null}}}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714116183","unity_version":"2022.3.11f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.11f1\\Editor\\Unity.exe -projectpath C:\\Users\\hassa\\OneDrive\\Skrivebord\\alt pro\\Unity stuff\\Unity ting\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-hassa -hubSessionId f8278c6f-053c-492d-a479-00a9dbf73437 -accessToken 1rPuSgTkgUUOXMaGthhixd2ZEngLQ-H31CETUrEqtzM005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"Map selector","end_time_seconds":"1714116213"}}
{"count":1,"self":25.826839999999997,"total":27.046067599999997,"children":{"InitializeActuators":{"count":8,"self":0.0010014,"total":0.0010014,"children":null},"InitializeSensors":{"count":8,"self":0.0020006,"total":0.0020006,"children":null},"AgentSendState":{"count":675,"self":0.09180859999999999,"total":0.1420426,"children":{"CollectObservations":{"count":1080,"self":0.018719799999999998,"total":0.018719799999999998,"children":null},"WriteActionMask":{"count":1080,"self":0.0025432,"total":0.0025432,"children":null},"RequestDecision":{"count":1080,"self":0.028971,"total":0.028971,"children":null}}},"DecideAction":{"count":675,"self":0.92951109999999992,"total":0.9457123,"children":{"RayPerceptionSensor.Perceive":{"count":2160,"self":0.0162012,"total":0.0162012,"children":null}}},"AgentAct":{"count":675,"self":0.128471,"total":0.128471,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714118721","unity_version":"2022.3.11f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.11f1\\Editor\\Unity.exe -projectpath C:\\Users\\hassa\\OneDrive\\Skrivebord\\alt pro\\Unity stuff\\Unity ting\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-hassa -hubSessionId f8278c6f-053c-492d-a479-00a9dbf73437 -accessToken 1rPuSgTkgUUOXMaGthhixd2ZEngLQ-H31CETUrEqtzM005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"Map selector","end_time_seconds":"1714118748"}}

View File

@@ -1632,6 +1632,140 @@ Transform:
m_CorrespondingSourceObject: {fileID: 1828470746108631247, guid: bb42b7aaa687b2f4d811c8cc5d2d259f, type: 3}
m_PrefabInstance: {fileID: 1409977001}
m_PrefabAsset: {fileID: 0}
--- !u!1 &902861123
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 902861124}
- component: {fileID: 902861126}
- component: {fileID: 902861125}
m_Layer: 5
m_Name: TellSelectedMap
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &902861124
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 902861123}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1978614972}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 200}
m_SizeDelta: {x: 500, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &902861125
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 902861123}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: test
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 1
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!222 &902861126
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 902861123}
m_CullTransparentMesh: 1
--- !u!1001 &935790745
PrefabInstance:
m_ObjectHideFlags: 0
@@ -2103,7 +2237,7 @@ GameObject:
- component: {fileID: 1181192973}
- component: {fileID: 1181192972}
m_Layer: 5
m_Name: MainText
m_Name: TellSelectedTime
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -2148,7 +2282,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text:
m_text: test
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@@ -2262,7 +2396,7 @@ MonoBehaviour:
Lights:
- {fileID: 1348142924}
- {fileID: 1179479087}
MainText: {fileID: 1181192972}
TellTime: {fileID: 1181192972}
--- !u!4 &1193353612
Transform:
m_ObjectHideFlags: 0
@@ -2452,7 +2586,7 @@ Light:
m_Type: 1
m_Shape: 0
m_Color: {r: 0.84483033, g: 0.84313726, b: 0.99215686, a: 1}
m_Intensity: 1.5
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
@@ -2786,7 +2920,8 @@ MonoBehaviour:
- {fileID: 541536234}
- {fileID: 1769403741}
CameraRotator: {fileID: 841402786}
scene: 0
scene:
TellMap: {fileID: 902861125}
--- !u!4 &1569276544 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 1122406829654900761, guid: 5a9f1aa26b2a080419f59c5b5385d3b4, type: 3}
@@ -3369,6 +3504,7 @@ RectTransform:
- {fileID: 59547259}
- {fileID: 1623944368}
- {fileID: 1181192971}
- {fileID: 902861124}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}

View File

@@ -3,23 +3,26 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using Unity.Mathematics;
using UnityEngine.UI;
using TMPro;
public class MapSelectorScript : MonoBehaviour
{
public GameObject[] Maps;
GameObject currentMap;
quaternion currentRotation;
public GameObject CameraRotator;
public int scene;
public string scene = "ForestRacetrack";
public TextMeshProUGUI TellMap;
void Start()
{
DisableAllMaps();
SelectMap(0);
DisableAllMaps();
ChangeToTrack2();
}
private void FixedUpdate()
{
CameraRotator.transform.eulerAngles += Vector3.up * 0.7f;
TellMap.text = "Selected map: \n" + scene;
}
void DisableAllMaps()
@@ -33,20 +36,18 @@ public class MapSelectorScript : MonoBehaviour
void SelectMap(int index)
{
DisableAllMaps();
currentMap = Maps[index];
currentMap.SetActive(true);
Maps[index].SetActive(true);
}
public void ChangeToTrack2()
{
scene = 2;
scene = "ForestRacetrack";
SelectMap(0);
}
public void ChangeToTrack3()
{
scene = 3;
scene = "CityRacetrack";
SelectMap(1);
}

View File

@@ -14,7 +14,7 @@ public class TimeOfDay : MonoBehaviour
public GameObject[] Lights;
public static TimeOfDay Instance;
public TextMeshProUGUI MainText;
public TextMeshProUGUI TellTime;
void DisableAllLights()
{
foreach (GameObject light in Lights)
@@ -42,10 +42,10 @@ public class TimeOfDay : MonoBehaviour
Instance = this;
DontDestroyOnLoad(gameObject);
DisableAllLights();
NightLight.SetActive(true);
ChangeToNightTime();
}
private void Update()
{
MainText.text = "Selected time of day: \n" + skyboxMaterial;
TellTime.text = "Selected time of day: \n" + skyboxMaterial;
}
}

View File

@@ -12,10 +12,10 @@ EditorBuildSettings:
path: Assets/Scenes/Map selector.unity
guid: 3bfd8ede691814e41941f96acfa07d03
- enabled: 1
path: Assets/Scenes/Racetrack mini.unity
path: Assets/Scenes/ForestRacetrack.unity
guid: 9b5f77be9dfb7c14cba3af351597ec83
- enabled: 1
path: Assets/Scenes/mini_racetrack3.unity
path: Assets/Scenes/CityRacetrack.unity
guid: 2d4634271c08833499c8478f17c7a330
- enabled: 1
path: Assets/Scenes/WinScreen.unity