Fixed some bugs and UI overlap caused by the restart and cursor lock additions
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user