Pause Menu Added
This commit is contained in:
parent
4941b676a3
commit
29f95e038d
35
Assets/InputSystem.inputsettings.asset
Normal file
35
Assets/InputSystem.inputsettings.asset
Normal file
@ -0,0 +1,35 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c46f07b5ed07e4e92aa78254188d3d10, type: 3}
|
||||
m_Name: InputSystem.inputsettings
|
||||
m_EditorClassIdentifier:
|
||||
m_SupportedDevices: []
|
||||
m_UpdateMode: 1
|
||||
m_MaxEventBytesPerUpdate: 5242880
|
||||
m_MaxQueuedEventsPerUpdate: 1000
|
||||
m_CompensateForScreenOrientation: 1
|
||||
m_BackgroundBehavior: 0
|
||||
m_EditorInputBehaviorInPlayMode: 0
|
||||
m_DefaultDeadzoneMin: 0.125
|
||||
m_DefaultDeadzoneMax: 0.925
|
||||
m_DefaultButtonPressPoint: 0.5
|
||||
m_ButtonReleaseThreshold: 0.75
|
||||
m_DefaultTapTime: 0.2
|
||||
m_DefaultSlowTapTime: 0.5
|
||||
m_DefaultHoldTime: 0.4
|
||||
m_TapRadius: 5
|
||||
m_MultiTapDelayTime: 0.75
|
||||
m_DisableRedundantEventsMerging: 0
|
||||
m_iOSSettings:
|
||||
m_MotionUsage:
|
||||
m_Enabled: 0
|
||||
m_Description:
|
||||
8
Assets/InputSystem.inputsettings.asset.meta
Normal file
8
Assets/InputSystem.inputsettings.asset.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98320edbf6dc6f447809b5027a818f6e
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -58,6 +58,15 @@
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"initialStateCheck": true
|
||||
},
|
||||
{
|
||||
"name": "PauseMenu",
|
||||
"type": "Button",
|
||||
"id": "5763b00d-b8c4-42e1-9a2a-98ad1e72a228",
|
||||
"expectedControlType": "Button",
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"initialStateCheck": false
|
||||
}
|
||||
],
|
||||
"bindings": [
|
||||
@ -280,6 +289,28 @@
|
||||
"action": "RaiseLowerGrapple",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "edc36f53-aaf5-4774-a92a-190e07b298f4",
|
||||
"path": "<Keyboard>/escape",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "PauseMenu",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "ec2230b0-47c0-42f0-bb41-eb5d3a9dd90a",
|
||||
"path": "<Gamepad>/start",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "PauseMenu",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -313,6 +344,15 @@
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"initialStateCheck": false
|
||||
},
|
||||
{
|
||||
"name": "PauseMenu",
|
||||
"type": "Button",
|
||||
"id": "cd1120f2-6170-419c-a8ec-14ec395e8724",
|
||||
"expectedControlType": "Button",
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"initialStateCheck": false
|
||||
}
|
||||
],
|
||||
"bindings": [
|
||||
@ -469,6 +509,28 @@
|
||||
"action": "AnyKeyPressed",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "17a22326-e65f-47ed-8cab-d4ef75102c77",
|
||||
"path": "<Keyboard>/escape",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "PauseMenu",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "652f1020-dbd2-4c92-98b4-5a3e0204891c",
|
||||
"path": "<Gamepad>/start",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "PauseMenu",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
4136
Assets/Scenes/PauseMenu.unity
Normal file
4136
Assets/Scenes/PauseMenu.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Scenes/PauseMenu.unity.meta
Normal file
7
Assets/Scenes/PauseMenu.unity.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f37b5fd7bc4007f44900b9b210476bea
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
51
Assets/Scripts/PauseMenuController.cs
Normal file
51
Assets/Scripts/PauseMenuController.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.UI;
|
||||
using static UnityEngine.Rendering.DebugUI;
|
||||
|
||||
public class PauseMenuController : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject pauseMenu;
|
||||
|
||||
private bool pauseMenuOpened = false;
|
||||
|
||||
public void PauseMenu(InputAction.CallbackContext context)
|
||||
{
|
||||
if (context.performed)
|
||||
{
|
||||
if (pauseMenuOpened)
|
||||
{
|
||||
ClosePauseMenu();
|
||||
}
|
||||
else
|
||||
{
|
||||
OpenPauseMenu();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenPauseMenu()
|
||||
{
|
||||
pauseMenu.SetActive(true);
|
||||
pauseMenuOpened = true;
|
||||
PauseGame();
|
||||
}
|
||||
|
||||
public void ClosePauseMenu()
|
||||
{
|
||||
pauseMenu.SetActive(false);
|
||||
pauseMenuOpened = false;
|
||||
ResumeGame();
|
||||
}
|
||||
|
||||
private void PauseGame()
|
||||
{
|
||||
Time.timeScale = 0;
|
||||
}
|
||||
private void ResumeGame()
|
||||
{
|
||||
Time.timeScale = 1;
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/PauseMenuController.cs.meta
Normal file
11
Assets/Scripts/PauseMenuController.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 681a55dd3deb2d74d929c98c9e6bfa69
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -21,5 +21,5 @@ EditorBuildSettings:
|
||||
path: Assets/Scenes/LevelDesign.unity
|
||||
guid: 4b213b8915c09ca49873cfadc143c61b
|
||||
m_configObjects:
|
||||
com.unity.input.settings: {fileID: 11400000, guid: 83b4255e269437642ad0474a7bdb56b5,
|
||||
com.unity.input.settings: {fileID: 11400000, guid: 98320edbf6dc6f447809b5027a818f6e,
|
||||
type: 2}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user