Browse Source

CoinUpdate now with specific route settings

lisa 2 years ago
parent
commit
28fc023f04
2 changed files with 20 additions and 1 deletions
  1. 9 1
      Assets/Coin/CoinUpdate.cs
  2. 11 0
      Assets/Scripts/Obstacles/SlalomPassed.cs.meta

+ 9 - 1
Assets/Coin/CoinUpdate.cs

@@ -2,12 +2,15 @@
 using System.Collections.Generic;
 using UnityEngine;
 using Pools;
+using Study;
 
 //Jede Kreuzung die eine Richtungsänderung der Route hervorruft braucht dieses Skript (jedoch nicht die Slalomreferenzpunkte)
 
 public class CoinUpdate : MonoBehaviour
 {
+    public int routeId = 9;
     private CoinCreation coinCreator;
+    //public ConditionManager cm;
 
     // Start is called before the first frame update
     void Start()
@@ -20,7 +23,12 @@ public class CoinUpdate : MonoBehaviour
     {
         if (other.gameObject.CompareTag("bike"))
         {
-            coinCreator.PlaceCoins();
+            var cm = GameObject.Find("ExperimentManager").GetComponent<ConditionManager>();
+            int routeNbr = cm.GetRouteNumber();
+            if (routeId == routeNbr) //only use skript for the route it belongs to
+            {
+                coinCreator.PlaceCoins();
+            }        
         }
     }
 }

+ 11 - 0
Assets/Scripts/Obstacles/SlalomPassed.cs.meta

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