Skip to content
Snippets Groups Projects
Commit f2913e85 authored by Kimi Heinonen's avatar Kimi Heinonen
Browse files

Merge branch 'master' of https://gitlab.utu.fi/eolokk/game_jam19

parents ea6c9887 5aa6ac5a
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,7 @@ public class Collector : MonoBehaviour
MoveTo(hit.collider.gameObject);
}
}
if (target != null)
if (move_to != null)
transform.position = Vector3.MoveTowards(new Vector3(transform.position.x, transform.position.y, -1f), move_to.transform.position, speed * Time.deltaTime);
}
private void OnTriggerEnter2D(Collider2D collision)
......@@ -67,7 +67,7 @@ public class Collector : MonoBehaviour
this.resource = this.target.GetComponent<Resource>();
StartCoroutine("goHome");
}
else if (collision.gameObject.name == "City" && this.resource != null)
else if (collision.gameObject.tag == "Home" && this.resource != null)
{
//resets amount and resource variables
collision.gameObject.GetComponent<City>().AddResource(this.resource, this.amount);
......
......@@ -15,9 +15,12 @@ public static class EventSystem
public static void EventHappened(EventType name)
{
Debug.Log("happened");
if (events.ContainsKey(name))
{
foreach (IAction e in events.Values){
Debug.Log("contains: "+events.Values.ToString());
foreach (IAction e in events[name]){
e.React(name);
}
}
......
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