Pull request #28: Pause Menu Added

Merge in CEGJ/32bit_jam_conjure from PauseMenu to Dev

* commit '29f95e038d93a0e0110c3a11ded8786e382f7e7c':
  Pause Menu Added
This commit is contained in:
Louis Horlaville 2022-10-30 20:07:36 +00:00 committed by Soulaha
commit d974340f7a
8 changed files with 4311 additions and 1 deletions

View 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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 98320edbf6dc6f447809b5027a818f6e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -58,6 +58,15 @@
"processors": "", "processors": "",
"interactions": "", "interactions": "",
"initialStateCheck": true "initialStateCheck": true
},
{
"name": "PauseMenu",
"type": "Button",
"id": "5763b00d-b8c4-42e1-9a2a-98ad1e72a228",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
} }
], ],
"bindings": [ "bindings": [
@ -280,6 +289,28 @@
"action": "RaiseLowerGrapple", "action": "RaiseLowerGrapple",
"isComposite": false, "isComposite": false,
"isPartOfComposite": true "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": "", "processors": "",
"interactions": "", "interactions": "",
"initialStateCheck": false "initialStateCheck": false
},
{
"name": "PauseMenu",
"type": "Button",
"id": "cd1120f2-6170-419c-a8ec-14ec395e8724",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
} }
], ],
"bindings": [ "bindings": [
@ -469,6 +509,28 @@
"action": "AnyKeyPressed", "action": "AnyKeyPressed",
"isComposite": false, "isComposite": false,
"isPartOfComposite": 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
} }
] ]
} }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f37b5fd7bc4007f44900b9b210476bea
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View 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;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 681a55dd3deb2d74d929c98c9e6bfa69
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -21,5 +21,5 @@ EditorBuildSettings:
path: Assets/Scenes/LevelDesign.unity path: Assets/Scenes/LevelDesign.unity
guid: 4b213b8915c09ca49873cfadc143c61b guid: 4b213b8915c09ca49873cfadc143c61b
m_configObjects: m_configObjects:
com.unity.input.settings: {fileID: 11400000, guid: 83b4255e269437642ad0474a7bdb56b5, com.unity.input.settings: {fileID: 11400000, guid: 98320edbf6dc6f447809b5027a818f6e,
type: 2} type: 2}