Replaced the gem with its old sprite and fine tuned the dirt placement since it still produced a few placements with the old sprite

This commit is contained in:
Gregory Campbell
2020-06-05 14:55:28 -04:00
parent fd0aa415da
commit a47832d6cf
3 changed files with 2 additions and 2 deletions
+2 -2
View File
@@ -93,6 +93,7 @@ public class GameScript : MonoBehaviour
Cursor.visible = true; Cursor.visible = true;
Object.transform.localScale = new Vector3(1, 1, 1); Object.transform.localScale = new Vector3(1, 1, 1);
Object.GetComponent<SpriteRenderer>().sprite = null; Object.GetComponent<SpriteRenderer>().sprite = null;
Destroy(Object.GetComponent<PolygonCollider2D>());
if(pickedUpItem != null && pickedUpItem.name == "Rag") if(pickedUpItem != null && pickedUpItem.name == "Rag")
{ {
@@ -135,11 +136,10 @@ public class GameScript : MonoBehaviour
placement = Physics2D.Raycast(new Vector2(xBound, yBound), Vector2.zero); placement = Physics2D.Raycast(new Vector2(xBound, yBound), Vector2.zero);
}while(placement.collider == null); }while(placement.collider == null || placement.collider.gameObject.tag != "Object");
Instantiate(Dirt, new Vector2(xBound, yBound), Quaternion.identity); Instantiate(Dirt, new Vector2(xBound, yBound), Quaternion.identity);
} }
Destroy(Object.GetComponent<PolygonCollider2D>());
} }
} }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.