Browse Source

Corrected method names

Marcel Zickler 3 years ago
parent
commit
d510bf641a

+ 3 - 3
Assets/Scripts/TrafficSimulation/CarPool.cs

@@ -34,7 +34,7 @@ namespace TrafficSimulation{
             }
         }
 
-        public GameObject getCar(){
+        public GameObject GetCar(){
             foreach(GameObject car in pooledCars){
                 if(!car.activeInHierarchy){
                     return car;
@@ -48,7 +48,7 @@ namespace TrafficSimulation{
         }
         public GameObject SpawnCar(Vector3 spawnPos, Quaternion spawnRot, Transform lookAt)
         {
-            GameObject car = this.getCar();
+            GameObject car = this.GetCar();
             if (car == null)
             {
                 Debug.Log("No car was available. Spawn aborted");
@@ -63,7 +63,7 @@ namespace TrafficSimulation{
             car.SetActive(true);
             return car;
         }
-        public void despawnCar(GameObject car){
+        public void DespawnCar(GameObject car){
             car.SetActive(false);
         }
     }

+ 1 - 1
Assets/Scripts/TrafficSimulation/CarSitter.cs

@@ -20,7 +20,7 @@ namespace TrafficSimulation{
         void checkRotation(){
             if(Vector3.Dot(gameObject.transform.up, Vector3.down) > 0.5){
                 Debug.Log("despawn car, because its turtleing!");
-                this.carPool.despawnCar(gameObject);
+                this.carPool.DespawnCar(gameObject);
             }
         }
 

+ 2 - 2
Assets/Scripts/TrafficSimulation/CarSpawner.cs

@@ -15,11 +15,11 @@ namespace TrafficSimulation{
         void Start()
         {
             foreach(Segment segment in trafficSystem.segments){
-                spawnOnSegment(segment);
+                SpawnOnSegment(segment);
             }
         }
         
-        void spawnOnSegment(Segment segment){
+        void SpawnOnSegment(Segment segment){
             if(segment == null){ 
                 Debug.Log("Segment is null");
                 return;

+ 1 - 1
Assets/Scripts/TrafficSimulation/IntersectionSituation/CarSituationSpawner.cs

@@ -91,7 +91,7 @@ namespace TrafficSimulation{
         /// </summary>
         /// <param name="car">GameObject</param>
         void DespawnCar(GameObject car){
-            this.carPool.despawnCar(car);
+            this.carPool.DespawnCar(car);
         }
         /// <summary>
         /// IEnumerator for the coroutine which spawns a car at the given position in the set spawnRate

+ 1 - 1
Assets/Scripts/TrafficSimulation/IntersectionSituation/IntersectionPreset.cs

@@ -81,7 +81,7 @@ namespace TrafficSimulation{
         /// </summary>
         private void DespawnCars(){
             Debug.Log("despawnCars");
-            this.activeCars.ForEach(car => this.carPool.despawnCar(car));
+            this.activeCars.ForEach(car => this.carPool.DespawnCar(car));
             this.activeCars.Clear();
             if(this.carSpawner != null){
                 this.carSpawner.StopSpawner();