Fixed some bugs and UI overlap caused by the restart and cursor lock additions

This commit is contained in:
Gregory Campbell
2020-04-28 20:25:18 -04:00
parent 7efe7b80fc
commit ba1704d878
2 changed files with 19 additions and 3 deletions
+16
View File
@@ -195,6 +195,22 @@ public class GMScript : MonoBehaviour
}
if (Input.GetMouseButtonDown(0))
{
Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
Vector2 mousePos2D = new Vector2(mousePos.x, mousePos.y);
RaycastHit2D hit = Physics2D.Raycast(mousePos2D, Vector2.zero);
if (hit.collider != null) {
if(hit.collider.gameObject.tag == "Restart")
{
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
}
}
if(cursorLock)
{