Skip to content
Snippets Groups Projects
Commit 83f7c279 authored by Erno Lokkila's avatar Erno Lokkila
Browse files

added tags to resources

parent 15b6a8e6
Branches
No related tags found
No related merge requests found
...@@ -4,12 +4,6 @@ using UnityEngine; ...@@ -4,12 +4,6 @@ using UnityEngine;
public class Collector : MonoBehaviour public class Collector : MonoBehaviour
{ {
// Start is called before the first frame update
void Start()
{
}
[SerializeField] [SerializeField]
private GameObject target; private GameObject target;
...@@ -29,6 +23,11 @@ public class Collector : MonoBehaviour ...@@ -29,6 +23,11 @@ public class Collector : MonoBehaviour
private Resource resource; private Resource resource;
public float speed = 1; public float speed = 1;
// Start is called before the first frame update
void Start()
{
home = GameObject.FindGameObjectWithTag("Home");
}
public void SetTarget(GameObject target) public void SetTarget(GameObject target)
{ {
...@@ -38,9 +37,7 @@ public class Collector : MonoBehaviour ...@@ -38,9 +37,7 @@ public class Collector : MonoBehaviour
{ {
this.move_to = target; this.move_to = target;
} }
GameObject lastClicked;
Ray ray;
RaycastHit rayHit;
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
......
...@@ -140,7 +140,7 @@ public class GroundGenerator : MonoBehaviour ...@@ -140,7 +140,7 @@ public class GroundGenerator : MonoBehaviour
private void createHome() { private void createHome() {
ground[ground.GetLength(0) / 2, ground.GetLength(1) / 2] = home; ground[ground.GetLength(0) / 2, ground.GetLength(1) / 2] = home;
spawn(homeGO, ground.GetLength(0) / 2, ground.GetLength(1) / 2, 0); 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) { private GameObject spawn(GameObject go, int x, int y, int z = 1) {
return Instantiate<GameObject>(go, new Vector3(x, y, z), Quaternion.identity); return Instantiate<GameObject>(go, new Vector3(x, y, z), Quaternion.identity);
......
...@@ -7,6 +7,7 @@ TagManager: ...@@ -7,6 +7,7 @@ TagManager:
- Road - Road
- Tree - Tree
- Resource - Resource
- Home
layers: layers:
- Default - Default
- TransparentFX - TransparentFX
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment