diff --git a/Assets/Scripts/Collector.cs b/Assets/Scripts/Collector.cs index d884dac73bec6951c7647ff0b69898855c102cd3..8279847034f59630778e7570d5baa94d33a9a64f 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 659461ee4f189be7ccd8f4585f1676e8c531794a..c5ff5924b3e107900071a9f60c73ab3d66f61192 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 20167db72fbbf7048673ef6229909d9e55a05797..07d529912098620c87aeb761dfa15f941a273be1 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -7,6 +7,7 @@ TagManager: - Road - Tree - Resource + - Home layers: - Default - TransparentFX