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

added tags to resources

parent 15b6a8e6
No related branches found
No related tags found
No related merge requests found
......@@ -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()
{
......
......@@ -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);
......
......@@ -7,6 +7,7 @@ TagManager:
- Road
- Tree
- Resource
- Home
layers:
- Default
- TransparentFX
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment