Browse Source

Merge branch 'master' of https://git.tk.informatik.tu-darmstadt.de/lisa.gasche/HoHCI-BikeSteering
merging

lisa 2 years ago
parent
commit
574420529f
2 changed files with 40 additions and 0 deletions
  1. 29 0
      Assets/Coin/CoinManagement.cs
  2. 11 0
      Assets/Coin/CoinManagement.cs.meta

+ 29 - 0
Assets/Coin/CoinManagement.cs

@@ -0,0 +1,29 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class CoinManagement : MonoBehaviour
+{
+    public GameObject coin = null;
+    // Start is called before the first frame update
+    void Start()
+    {
+        Vector3 start = new Vector3(298.9206f, 0.5000005f, -0.1749458f); 
+        Vector3 finish = new Vector3(400f, 0.5000005f, -0.1749458f);
+        PlaceCoins(start, finish, 20);
+    }
+
+    // Update is called once per frame
+    void Update()
+    {
+    }
+
+    void PlaceCoins(Vector3 start, Vector3 finish, float number) 
+    {
+        float space = System.Math.Abs(start.x - finish.x)/number;
+        for (int i=0; i < number; ++i) 
+        {
+            Instantiate(coin, new Vector3(start.x + i*space, start.y, start.z), Quaternion.Euler(0f, 0f, 90f));
+        } 
+    } 
+}

+ 11 - 0
Assets/Coin/CoinManagement.cs.meta

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