Skip to content

Commit

Permalink
add to the scene
Browse files Browse the repository at this point in the history
Signed-off-by: Alptuğ Cırıt <[email protected]>
  • Loading branch information
mozhoku committed Sep 23, 2024
1 parent f91f9d8 commit b189596
Show file tree
Hide file tree
Showing 4 changed files with 193 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Assets/AWSIM/Prefabs/UI/Vehicle Dashboard.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ RectTransform:
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 125, y: 50}
m_SizeDelta: {x: 125, y: 70}
m_Pivot: {x: 1, y: 0}
--- !u!222 &5985526962340375484
CanvasRenderer:
Expand Down
183 changes: 183 additions & 0 deletions Assets/AWSIM/Scenes/Composition/AWSIMSimulation.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,188 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: -20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1001 &291706002
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1987073787}
m_Modifications:
- target: {fileID: 490485276830483272, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 490485276830483272, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 490485276830483272, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 490485276830483272, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 490485276830483272, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1540594835373909981, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1540594835373909981, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1540594835373909981, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1540594835373909981, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1540594835373909981, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_Pivot.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchorMin.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_SizeDelta.x
value: 125
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_SizeDelta.y
value: 70
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4430727111052778003, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_Name
value: Vehicle Dashboard
objectReference: {fileID: 0}
- target: {fileID: 8816851931006714352, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8816851931006714352, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8816851931006714352, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8816851931006714352, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8816851931006714352, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8953770003924022276, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8953770003924022276, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8953770003924022276, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8953770003924022276, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8953770003924022276, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
--- !u!224 &291706003 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1975691864731210933, guid: 52acd88437755e335b0382890e7e45b2, type: 3}
m_PrefabInstance: {fileID: 291706002}
m_PrefabAsset: {fileID: 0}
--- !u!1 &364586755
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -10288,6 +10470,7 @@ RectTransform:
- {fileID: 2090544236}
- {fileID: 1816359443}
- {fileID: 565615452}
- {fileID: 291706003}
m_Father: {fileID: 985464703}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
Expand Down
8 changes: 3 additions & 5 deletions Assets/AWSIM/Scripts/Loader/SimConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using System.Linq;
using AWSIM.Scripts.UI.Toggle;
using AWSIM.Scripts.UI;
using AWSIM.TrafficSimulation;
Expand Down Expand Up @@ -87,6 +82,9 @@ static public void Configure(EgosManager egoManager, MapManager mapManager, Simu
UIMainCameraToggle uiMainCameraToggle = GameObject.FindObjectOfType<UIMainCameraToggle>();
uiMainCameraToggle.Activate();

VehicleDashboard vehicleDashboard = GameObject.FindObjectOfType<VehicleDashboard>();
vehicleDashboard.Activate();

// Set traffic on/off
var trafficSims = GameObject.FindObjectsOfType<TrafficSimulation.TrafficManager>();
foreach (var trafficSim in trafficSims)
Expand Down
7 changes: 6 additions & 1 deletion Assets/AWSIM/Scripts/UI/VehicleDashboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ private void Start()
}
}

public void Activate()
{
Start();
}

private void FixedUpdate()
{
if (_vehicleController == null) return;
Expand Down Expand Up @@ -103,7 +108,7 @@ private static string UpdateSpeed(VPVehicleController vehicle)
return speedVal.ToString("F0");
}

private string UpdateTransmissionMode(int modeVal)
private static string UpdateTransmissionMode(int modeVal)
{
return modeVal switch
{
Expand Down

0 comments on commit b189596

Please sign in to comment.