forked from tier4/AWSIM
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alptuğ Cırıt <[email protected]>
- Loading branch information
Showing
39 changed files
with
5,777 additions
and
846 deletions.
There are no files selected for viewing
4,460 changes: 3,617 additions & 843 deletions
4,460
Assets/AWSIM/Scenes/Main/AutowareSimulation.unity
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using System; | ||
using AWSIM.TrafficSimulation; | ||
using UnityEngine; | ||
|
||
namespace AWSIM.Scripts.UI | ||
{ | ||
public class TrafficControlManager : MonoBehaviour | ||
{ | ||
public TrafficManager TrafficManager { private get; set; } | ||
|
||
public void TrafficManagerPauseResumeToggle() | ||
{ | ||
if (TrafficManager.gameObject.activeSelf) | ||
{ | ||
TrafficManager.enabled = !TrafficManager.enabled; | ||
} | ||
else | ||
Debug.Log("TrafficManager is not active. Can't pause/resume!"); | ||
} | ||
|
||
public void TrafficManagerEnable() | ||
{ | ||
TrafficManager.gameObject.SetActive(true); | ||
TrafficManager.enabled = true; | ||
} | ||
|
||
public void TrafficManagerDisable() | ||
{ | ||
TrafficManager.gameObject.SetActive(false); | ||
} | ||
|
||
public void TrafficManagerReset() | ||
{ | ||
if (TrafficManager.gameObject.activeSelf) | ||
{ | ||
TrafficManager.enabled = true; | ||
TrafficManager.npcVehicleSimulator.ClearAll(); | ||
} | ||
else | ||
{ | ||
TrafficManager.gameObject.SetActive(true); | ||
TrafficManager.enabled = true; | ||
TrafficManager.npcVehicleSimulator.ClearAll(); | ||
} | ||
} | ||
|
||
public void TrafficMangerSetSeed(int seed) | ||
{ | ||
if (!TrafficManager.gameObject.activeSelf) | ||
{ | ||
Debug.LogWarning("TrafficManager is not active. Can't set seed!"); | ||
} | ||
|
||
TrafficManager.seed = seed; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,56 @@ | ||
using System; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
namespace AWSIM.Scripts.UI | ||
{ | ||
public class UIBridge : MonoBehaviour | ||
{ | ||
private EgoVehiclePositionManager egoVehiclePositionManager; | ||
private TrafficControlManager trafficControlManager; | ||
[SerializeField] InputField trafficSeedInputField; | ||
|
||
private void Awake() | ||
{ | ||
egoVehiclePositionManager = GetComponent<EgoVehiclePositionManager>(); | ||
trafficControlManager = GetComponent<TrafficControlManager>(); | ||
} | ||
|
||
public void ResetEgoToSpawnPoint() | ||
{ | ||
egoVehiclePositionManager.ResetEgoToSpawnPoint(); | ||
} | ||
|
||
public void TrafficManagerPauseResumeToggle() | ||
{ | ||
trafficControlManager.TrafficManagerPauseResumeToggle(); | ||
} | ||
|
||
public void TrafficManagerEnable() | ||
{ | ||
trafficControlManager.TrafficManagerEnable(); | ||
} | ||
|
||
public void TrafficManagerDisable() | ||
{ | ||
trafficControlManager.TrafficManagerDisable(); | ||
} | ||
|
||
public void TrafficManagerReset() | ||
{ | ||
trafficControlManager.TrafficManagerReset(); | ||
} | ||
|
||
public void TrafficMangerSetSeed() | ||
{ | ||
if (!trafficSeedInputField) | ||
{ | ||
Debug.LogWarning("TrafficSeedInputField reference is missing. Can't set seed without it!"); | ||
return; | ||
} | ||
|
||
var seed = Convert.ToInt32(trafficSeedInputField.text); | ||
trafficControlManager.TrafficMangerSetSeed(seed); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
103 changes: 103 additions & 0 deletions
103
Assets/Unity-UI-Rounded-Corners/Examples/Lenna.png.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.