Skip to content
Snippets Groups Projects
Commit c764290b authored by Petteri's avatar Petteri
Browse files

Revert "Collector update"

This reverts commit bd780c91.
parent bd780c91
No related branches found
No related tags found
No related merge requests found
...@@ -140,16 +140,16 @@ public class Collector : MonoBehaviour ...@@ -140,16 +140,16 @@ public class Collector : MonoBehaviour
{ {
if (collision.gameObject.GetComponent<BoxCollider2D>().bounds.Contains(new Vector3(home.transform.position.x, home.transform.position.y, collision.gameObject.transform.position.z))) if (collision.gameObject.GetComponent<BoxCollider2D>().bounds.Contains(new Vector3(home.transform.position.x, home.transform.position.y, collision.gameObject.transform.position.z)))
{ {
if (target != null && target.GetComponent<Outcrop>() && this.Requested_resource != null) if (target.GetComponent<Outcrop>() && this.Requested_resource != null)
{ {
if(this.Requested_amount < this.max_amount) if(this.Requested_amount < this.max_amount)
this.amount = home.GetComponent<City>().UseResource(this.Requested_resource, this.Requested_amount); this.amount = home.GetComponent<City>().UseResource(this.Requested_resource, this.Requested_amount);
else else
this.amount = home.GetComponent<City>().UseResource(this.Requested_resource, this.max_amount); this.amount = home.GetComponent<City>().UseResource(this.Requested_resource, this.max_amount);
} }
else if (collision.gameObject.GetComponent<City>() != null) else
{ {
//resets amount and resource variables //resets amount and resource variables
collision.gameObject.GetComponent<City>().AddResource(this.resource, this.amount); collision.gameObject.GetComponent<City>().AddResource(this.resource, this.amount);
this.amount = 0; this.amount = 0;
......
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