Basic main menu implemented

This commit is contained in:
Gregory Campbell
2020-07-11 20:17:57 -04:00
parent e9abec92df
commit 89f917f787
19 changed files with 942 additions and 2 deletions
+33
View File
@@ -0,0 +1,33 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class MenuScript : MonoBehaviour
{
void Update(){
Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
Vector2 mousePos2D = new Vector2(mousePos.x, mousePos.y);
RaycastHit2D hit = Physics2D.Raycast(mousePos2D, Vector2.zero);
if(Input.GetMouseButtonDown(0)){
if(hit.collider.gameObject.tag == "Play")
{
SceneManager.LoadScene("Game");
} else if(hit.collider.gameObject.tag == "Quit")
{
Application.Quit();
}
}
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 78647751f60f07d4390eae758b1fe05f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: