Skip to content

Commit

Permalink
menus, movement
Browse files Browse the repository at this point in the history
menus and movement (wall collisions)
  • Loading branch information
theradest1 committed Mar 3, 2022
1 parent 5782ec6 commit fe9cdfd
Show file tree
Hide file tree
Showing 7 changed files with 2,970 additions and 257 deletions.
37 changes: 37 additions & 0 deletions Assets/Menu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Menu : MonoBehaviour
{

public Canvas menu;
public GameObject settings;
public GameObject main;
public GameObject hidden;
public GameObject controls;

public void quit(){
Application.Quit();
}
public void open(){
if(!menu.gameObject.activeSelf){
menu.gameObject.SetActive(true);
OpenMenu(main);
}
else{
menu.gameObject.SetActive(false);
}
}
public void OpenMenu(GameObject thing){
AllOff();
thing.SetActive(true);
}
public void AllOff(){
main.SetActive(false);
settings.SetActive(false);
hidden.SetActive(false);
controls.SetActive(false);
}
}
11 changes: 11 additions & 0 deletions Assets/Menu.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions Assets/PlayerInput.inputactions
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "Menu",
"type": "Button",
"id": "1177a59b-4871-4e5c-a326-a8003d2a506c",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": true
}
],
"bindings": [
Expand Down Expand Up @@ -474,6 +483,28 @@
"action": "RightBlockSwitch",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "3856aebb-392f-4971-be78-b8213730b49d",
"path": "<Keyboard>/escape",
"interactions": "",
"processors": "",
"groups": "Keyboard",
"action": "Menu",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "0f231fc1-db04-4f60-a38b-624f385152c8",
"path": "<Gamepad>/start",
"interactions": "",
"processors": "",
"groups": "Controller",
"action": "Menu",
"isComposite": false,
"isPartOfComposite": false
}
]
}
Expand Down
Loading

0 comments on commit fe9cdfd

Please sign in to comment.