From 83f7c2794632b709803ff208417ffe025391592a Mon Sep 17 00:00:00 2001
From: Erno Lokkila <eolokk@utu.fi>
Date: Sat, 2 Mar 2019 23:04:28 +0200
Subject: [PATCH] added tags to resources

---
 Assets/Scripts/Collector.cs                       | 15 ++++++---------
 Assets/Scripts/GroundGenerator/GroundGenerator.cs |  2 +-
 ProjectSettings/TagManager.asset                  |  1 +
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/Assets/Scripts/Collector.cs b/Assets/Scripts/Collector.cs
index d884dac..8279847 100644
--- a/Assets/Scripts/Collector.cs
+++ b/Assets/Scripts/Collector.cs
@@ -4,12 +4,6 @@ using UnityEngine;
 
 public class Collector : MonoBehaviour
 {
-    // Start is called before the first frame update
-    void Start()
-    {
-
-    }
-
     [SerializeField]
     private GameObject target;
 
@@ -29,6 +23,11 @@ public class Collector : MonoBehaviour
     private Resource resource;
     public float speed = 1;
 
+    // Start is called before the first frame update
+    void Start()
+    {
+        home = GameObject.FindGameObjectWithTag("Home");
+    }
 
     public void SetTarget(GameObject target)
     {
@@ -38,9 +37,7 @@ public class Collector : MonoBehaviour
     {
         this.move_to = target;
     }
-    GameObject lastClicked;
-    Ray ray;
-    RaycastHit rayHit;
+
     // Update is called once per frame
     void Update()
     {
diff --git a/Assets/Scripts/GroundGenerator/GroundGenerator.cs b/Assets/Scripts/GroundGenerator/GroundGenerator.cs
index 659461e..c5ff592 100644
--- a/Assets/Scripts/GroundGenerator/GroundGenerator.cs
+++ b/Assets/Scripts/GroundGenerator/GroundGenerator.cs
@@ -140,7 +140,7 @@ public class GroundGenerator : MonoBehaviour
     private void createHome() {
         ground[ground.GetLength(0) / 2, ground.GetLength(1) / 2] = home;
         spawn(homeGO, ground.GetLength(0) / 2, ground.GetLength(1) / 2, 0);
-        spawn(workerGO, ground.GetLength(0) / 2, ground.GetLength(1) / 2, 0);
+        spawn(workerGO, ground.GetLength(0) / 2, ground.GetLength(1) / 2, -3);
     }
     private GameObject spawn(GameObject go, int x, int y, int z = 1) {
         return Instantiate<GameObject>(go, new Vector3(x, y, z), Quaternion.identity);
diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset
index 20167db..07d5299 100644
--- a/ProjectSettings/TagManager.asset
+++ b/ProjectSettings/TagManager.asset
@@ -7,6 +7,7 @@ TagManager:
   - Road
   - Tree
   - Resource
+  - Home
   layers:
   - Default
   - TransparentFX
-- 
GitLab