Pull request #16: Add Pause and Restart Menu
Merge in CEGJ/creative-jam-20 from PauseRestartMenu to main * commit '7a572b6bfb15f6522eb6bc5954249c3f939b59c8': fix unpause when going to main menu added restart option to menu added pause menu added pause menu
This commit is contained in:
commit
686e543b56
134
Assets/Animation/PauseMenu.anim
Normal file
134
Assets/Animation/PauseMenu.anim
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!74 &7400000
|
||||||
|
AnimationClip:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: PauseMenu
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Legacy: 0
|
||||||
|
m_Compressed: 0
|
||||||
|
m_UseHighQualityCurve: 1
|
||||||
|
m_RotationCurves: []
|
||||||
|
m_CompressedRotationCurves: []
|
||||||
|
m_EulerCurves: []
|
||||||
|
m_PositionCurves: []
|
||||||
|
m_ScaleCurves: []
|
||||||
|
m_FloatCurves:
|
||||||
|
- curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.33333334
|
||||||
|
value: 0.29803923
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.5
|
||||||
|
value: 0.2509804
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
attribute: m_Color.a
|
||||||
|
path:
|
||||||
|
classID: 114
|
||||||
|
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
m_PPtrCurves: []
|
||||||
|
m_SampleRate: 60
|
||||||
|
m_WrapMode: 0
|
||||||
|
m_Bounds:
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
m_Extent: {x: 0, y: 0, z: 0}
|
||||||
|
m_ClipBindingConstant:
|
||||||
|
genericBindings:
|
||||||
|
- serializedVersion: 2
|
||||||
|
path: 0
|
||||||
|
attribute: 304273561
|
||||||
|
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
typeID: 114
|
||||||
|
customType: 0
|
||||||
|
isPPtrCurve: 0
|
||||||
|
pptrCurveMapping: []
|
||||||
|
m_AnimationClipSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_AdditiveReferencePoseClip: {fileID: 0}
|
||||||
|
m_AdditiveReferencePoseTime: 0
|
||||||
|
m_StartTime: 0
|
||||||
|
m_StopTime: 0.5
|
||||||
|
m_OrientationOffsetY: 0
|
||||||
|
m_Level: 0
|
||||||
|
m_CycleOffset: 0
|
||||||
|
m_HasAdditiveReferencePose: 0
|
||||||
|
m_LoopTime: 0
|
||||||
|
m_LoopBlend: 0
|
||||||
|
m_LoopBlendOrientation: 0
|
||||||
|
m_LoopBlendPositionY: 0
|
||||||
|
m_LoopBlendPositionXZ: 0
|
||||||
|
m_KeepOriginalOrientation: 0
|
||||||
|
m_KeepOriginalPositionY: 1
|
||||||
|
m_KeepOriginalPositionXZ: 0
|
||||||
|
m_HeightFromFeet: 0
|
||||||
|
m_Mirror: 0
|
||||||
|
m_EditorCurves:
|
||||||
|
- curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.33333334
|
||||||
|
value: 0.29803923
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.5
|
||||||
|
value: 0.2509804
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
attribute: m_Color.a
|
||||||
|
path:
|
||||||
|
classID: 114
|
||||||
|
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
m_EulerEditorCurves: []
|
||||||
|
m_HasGenericRootTransform: 0
|
||||||
|
m_HasMotionFloatCurves: 0
|
||||||
|
m_Events: []
|
||||||
8
Assets/Animation/PauseMenu.anim.meta
Normal file
8
Assets/Animation/PauseMenu.anim.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4c2010dc8f9408842b0fa215c5b04483
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 7400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
72
Assets/Animation/PauseMenu.controller
Normal file
72
Assets/Animation/PauseMenu.controller
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1107 &-6640196898425865278
|
||||||
|
AnimatorStateMachine:
|
||||||
|
serializedVersion: 6
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: Base Layer
|
||||||
|
m_ChildStates:
|
||||||
|
- serializedVersion: 1
|
||||||
|
m_State: {fileID: -2038024013379258471}
|
||||||
|
m_Position: {x: 200, y: 0, z: 0}
|
||||||
|
m_ChildStateMachines: []
|
||||||
|
m_AnyStateTransitions: []
|
||||||
|
m_EntryTransitions: []
|
||||||
|
m_StateMachineTransitions: {}
|
||||||
|
m_StateMachineBehaviours: []
|
||||||
|
m_AnyStatePosition: {x: 50, y: 20, z: 0}
|
||||||
|
m_EntryPosition: {x: 50, y: 120, z: 0}
|
||||||
|
m_ExitPosition: {x: 800, y: 120, z: 0}
|
||||||
|
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
|
||||||
|
m_DefaultState: {fileID: -2038024013379258471}
|
||||||
|
--- !u!1102 &-2038024013379258471
|
||||||
|
AnimatorState:
|
||||||
|
serializedVersion: 6
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: PauseMenu
|
||||||
|
m_Speed: 1
|
||||||
|
m_CycleOffset: 0
|
||||||
|
m_Transitions: []
|
||||||
|
m_StateMachineBehaviours: []
|
||||||
|
m_Position: {x: 50, y: 50, z: 0}
|
||||||
|
m_IKOnFeet: 0
|
||||||
|
m_WriteDefaultValues: 1
|
||||||
|
m_Mirror: 0
|
||||||
|
m_SpeedParameterActive: 0
|
||||||
|
m_MirrorParameterActive: 0
|
||||||
|
m_CycleOffsetParameterActive: 0
|
||||||
|
m_TimeParameterActive: 0
|
||||||
|
m_Motion: {fileID: 7400000, guid: 4c2010dc8f9408842b0fa215c5b04483, type: 2}
|
||||||
|
m_Tag:
|
||||||
|
m_SpeedParameter:
|
||||||
|
m_MirrorParameter:
|
||||||
|
m_CycleOffsetParameter:
|
||||||
|
m_TimeParameter:
|
||||||
|
--- !u!91 &9100000
|
||||||
|
AnimatorController:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: PauseMenu
|
||||||
|
serializedVersion: 5
|
||||||
|
m_AnimatorParameters: []
|
||||||
|
m_AnimatorLayers:
|
||||||
|
- serializedVersion: 5
|
||||||
|
m_Name: Base Layer
|
||||||
|
m_StateMachine: {fileID: -6640196898425865278}
|
||||||
|
m_Mask: {fileID: 0}
|
||||||
|
m_Motions: []
|
||||||
|
m_Behaviours: []
|
||||||
|
m_BlendingMode: 0
|
||||||
|
m_SyncedLayerIndex: -1
|
||||||
|
m_DefaultWeight: 0
|
||||||
|
m_IKPass: 0
|
||||||
|
m_SyncedLayerAffectsTiming: 0
|
||||||
|
m_Controller: {fileID: 9100000}
|
||||||
8
Assets/Animation/PauseMenu.controller.meta
Normal file
8
Assets/Animation/PauseMenu.controller.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8e5cd162fe88c4144a55c0e39b4d27f2
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 9100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Art/UI/icon_alert_exclamation.png
(Stored with Git LFS)
Normal file
BIN
Assets/Art/UI/icon_alert_exclamation.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Assets/Art/UI/icon_alert_exclamation.png.meta
(Stored with Git LFS)
Normal file
BIN
Assets/Art/UI/icon_alert_exclamation.png.meta
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Assets/Art/UI/icon_alert_triangle.png
(Stored with Git LFS)
Normal file
BIN
Assets/Art/UI/icon_alert_triangle.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Assets/Art/UI/icon_alert_triangle.png.meta
(Stored with Git LFS)
Normal file
BIN
Assets/Art/UI/icon_alert_triangle.png.meta
(Stored with Git LFS)
Normal file
Binary file not shown.
174
Assets/InputMaster.cs
Normal file
174
Assets/InputMaster.cs
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
||||||
|
// version 1.3.0
|
||||||
|
// from Assets/InputMaster.inputactions
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine.InputSystem;
|
||||||
|
using UnityEngine.InputSystem.Utilities;
|
||||||
|
|
||||||
|
public partial class @InputMaster : IInputActionCollection2, IDisposable
|
||||||
|
{
|
||||||
|
public InputActionAsset asset { get; }
|
||||||
|
public @InputMaster()
|
||||||
|
{
|
||||||
|
asset = InputActionAsset.FromJson(@"{
|
||||||
|
""name"": ""InputMaster"",
|
||||||
|
""maps"": [
|
||||||
|
{
|
||||||
|
""name"": ""Menu"",
|
||||||
|
""id"": ""725208ea-b0f7-41fe-982e-4e4f1968f986"",
|
||||||
|
""actions"": [
|
||||||
|
{
|
||||||
|
""name"": ""Pause"",
|
||||||
|
""type"": ""Button"",
|
||||||
|
""id"": ""6c625271-9120-4d38-a871-07fa3656839f"",
|
||||||
|
""expectedControlType"": ""Button"",
|
||||||
|
""processors"": """",
|
||||||
|
""interactions"": """",
|
||||||
|
""initialStateCheck"": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
""bindings"": [
|
||||||
|
{
|
||||||
|
""name"": """",
|
||||||
|
""id"": ""9af28864-137e-4371-9bba-31d99ca1d162"",
|
||||||
|
""path"": ""<Keyboard>/space"",
|
||||||
|
""interactions"": ""Press"",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""Pause"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": """",
|
||||||
|
""id"": ""0b994463-6cbd-4144-9d18-a6cd898b2e06"",
|
||||||
|
""path"": ""<Keyboard>/p"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""Pause"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": """",
|
||||||
|
""id"": ""f6e7edd8-d5b2-4e34-b651-eeeabdc4a16b"",
|
||||||
|
""path"": ""<Keyboard>/escape"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""Pause"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
""controlSchemes"": []
|
||||||
|
}");
|
||||||
|
// Menu
|
||||||
|
m_Menu = asset.FindActionMap("Menu", throwIfNotFound: true);
|
||||||
|
m_Menu_Pause = m_Menu.FindAction("Pause", throwIfNotFound: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
UnityEngine.Object.Destroy(asset);
|
||||||
|
}
|
||||||
|
|
||||||
|
public InputBinding? bindingMask
|
||||||
|
{
|
||||||
|
get => asset.bindingMask;
|
||||||
|
set => asset.bindingMask = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReadOnlyArray<InputDevice>? devices
|
||||||
|
{
|
||||||
|
get => asset.devices;
|
||||||
|
set => asset.devices = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
|
||||||
|
|
||||||
|
public bool Contains(InputAction action)
|
||||||
|
{
|
||||||
|
return asset.Contains(action);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerator<InputAction> GetEnumerator()
|
||||||
|
{
|
||||||
|
return asset.GetEnumerator();
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerator IEnumerable.GetEnumerator()
|
||||||
|
{
|
||||||
|
return GetEnumerator();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Enable()
|
||||||
|
{
|
||||||
|
asset.Enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Disable()
|
||||||
|
{
|
||||||
|
asset.Disable();
|
||||||
|
}
|
||||||
|
public IEnumerable<InputBinding> bindings => asset.bindings;
|
||||||
|
|
||||||
|
public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
|
||||||
|
{
|
||||||
|
return asset.FindAction(actionNameOrId, throwIfNotFound);
|
||||||
|
}
|
||||||
|
public int FindBinding(InputBinding bindingMask, out InputAction action)
|
||||||
|
{
|
||||||
|
return asset.FindBinding(bindingMask, out action);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Menu
|
||||||
|
private readonly InputActionMap m_Menu;
|
||||||
|
private IMenuActions m_MenuActionsCallbackInterface;
|
||||||
|
private readonly InputAction m_Menu_Pause;
|
||||||
|
public struct MenuActions
|
||||||
|
{
|
||||||
|
private @InputMaster m_Wrapper;
|
||||||
|
public MenuActions(@InputMaster wrapper) { m_Wrapper = wrapper; }
|
||||||
|
public InputAction @Pause => m_Wrapper.m_Menu_Pause;
|
||||||
|
public InputActionMap Get() { return m_Wrapper.m_Menu; }
|
||||||
|
public void Enable() { Get().Enable(); }
|
||||||
|
public void Disable() { Get().Disable(); }
|
||||||
|
public bool enabled => Get().enabled;
|
||||||
|
public static implicit operator InputActionMap(MenuActions set) { return set.Get(); }
|
||||||
|
public void SetCallbacks(IMenuActions instance)
|
||||||
|
{
|
||||||
|
if (m_Wrapper.m_MenuActionsCallbackInterface != null)
|
||||||
|
{
|
||||||
|
@Pause.started -= m_Wrapper.m_MenuActionsCallbackInterface.OnPause;
|
||||||
|
@Pause.performed -= m_Wrapper.m_MenuActionsCallbackInterface.OnPause;
|
||||||
|
@Pause.canceled -= m_Wrapper.m_MenuActionsCallbackInterface.OnPause;
|
||||||
|
}
|
||||||
|
m_Wrapper.m_MenuActionsCallbackInterface = instance;
|
||||||
|
if (instance != null)
|
||||||
|
{
|
||||||
|
@Pause.started += instance.OnPause;
|
||||||
|
@Pause.performed += instance.OnPause;
|
||||||
|
@Pause.canceled += instance.OnPause;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public MenuActions @Menu => new MenuActions(this);
|
||||||
|
public interface IMenuActions
|
||||||
|
{
|
||||||
|
void OnPause(InputAction.CallbackContext context);
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/InputMaster.cs.meta
Normal file
11
Assets/InputMaster.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 36bb7aa027f269a40ac0c1f0726cd204
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
56
Assets/InputMaster.inputactions
Normal file
56
Assets/InputMaster.inputactions
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
"name": "InputMaster",
|
||||||
|
"maps": [
|
||||||
|
{
|
||||||
|
"name": "Menu",
|
||||||
|
"id": "725208ea-b0f7-41fe-982e-4e4f1968f986",
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"name": "Pause",
|
||||||
|
"type": "Button",
|
||||||
|
"id": "6c625271-9120-4d38-a871-07fa3656839f",
|
||||||
|
"expectedControlType": "Button",
|
||||||
|
"processors": "",
|
||||||
|
"interactions": "",
|
||||||
|
"initialStateCheck": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"bindings": [
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "9af28864-137e-4371-9bba-31d99ca1d162",
|
||||||
|
"path": "<Keyboard>/space",
|
||||||
|
"interactions": "Press",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "Pause",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "0b994463-6cbd-4144-9d18-a6cd898b2e06",
|
||||||
|
"path": "<Keyboard>/p",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "Pause",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "f6e7edd8-d5b2-4e34-b651-eeeabdc4a16b",
|
||||||
|
"path": "<Keyboard>/escape",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "Pause",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"controlSchemes": []
|
||||||
|
}
|
||||||
14
Assets/InputMaster.inputactions.meta
Normal file
14
Assets/InputMaster.inputactions.meta
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5de64a295a15c8f4289b6fdfcac5b5f8
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3}
|
||||||
|
generateWrapperCode: 1
|
||||||
|
wrapperCodePath:
|
||||||
|
wrapperClassName:
|
||||||
|
wrapperCodeNamespace:
|
||||||
21806
Assets/Scenes/NaomiScene.unity
Normal file
21806
Assets/Scenes/NaomiScene.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Scenes/NaomiScene.unity.meta
Normal file
7
Assets/Scenes/NaomiScene.unity.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 82fe130aef9b792479ad11602bcfa343
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
75
Assets/Scripts/PauseMenu.cs
Normal file
75
Assets/Scripts/PauseMenu.cs
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.InputSystem;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
public class PauseMenu : MonoBehaviour
|
||||||
|
{
|
||||||
|
public static bool IsPaused = false;
|
||||||
|
|
||||||
|
[SerializeField] InputMaster inputAction;
|
||||||
|
[SerializeField] GameObject pauseMenu;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
inputAction = new InputMaster();
|
||||||
|
inputAction.Menu.Pause.performed += _ => ExecutePauseUnpause();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ExecutePauseUnpause()
|
||||||
|
{
|
||||||
|
Debug.Log("ExecutePauseUnpause");
|
||||||
|
if (IsPaused)
|
||||||
|
ResumeGame();
|
||||||
|
else
|
||||||
|
PauseGame();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
inputAction.Enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
inputAction.Disable();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PauseGame()
|
||||||
|
{
|
||||||
|
Time.timeScale = 0f;
|
||||||
|
IsPaused = true;
|
||||||
|
pauseMenu.SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ResumeGame()
|
||||||
|
{
|
||||||
|
Time.timeScale = 1f;
|
||||||
|
IsPaused = false;
|
||||||
|
pauseMenu.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LoadMenu()
|
||||||
|
{
|
||||||
|
Time.timeScale = 1f;
|
||||||
|
IsPaused = false;
|
||||||
|
SceneManager.LoadScene(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RestartGame()
|
||||||
|
{
|
||||||
|
Time.timeScale = 1f;
|
||||||
|
IsPaused = false;
|
||||||
|
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void QuitGame()
|
||||||
|
{
|
||||||
|
Debug.Log("QuitGame");
|
||||||
|
Application.Quit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
11
Assets/Scripts/PauseMenu.cs.meta
Normal file
11
Assets/Scripts/PauseMenu.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 28eeeff0d050a054b922df891e1740a3
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -2,14 +2,17 @@
|
|||||||
%TAG !u! tag:unity3d.com,2011:
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
--- !u!21 &2100000
|
--- !u!21 &2100000
|
||||||
Material:
|
Material:
|
||||||
serializedVersion: 6
|
serializedVersion: 8
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: LiberationSans SDF - Drop Shadow
|
m_Name: LiberationSans SDF - Drop Shadow
|
||||||
m_Shader: {fileID: 4800000, guid: fe393ace9b354375a9cb14cdbbc28be4, type: 3}
|
m_Shader: {fileID: 4800000, guid: fe393ace9b354375a9cb14cdbbc28be4, type: 3}
|
||||||
m_ShaderKeywords: OUTLINE_ON UNDERLAY_ON
|
m_ValidKeywords:
|
||||||
|
- OUTLINE_ON
|
||||||
|
- UNDERLAY_ON
|
||||||
|
m_InvalidKeywords: []
|
||||||
m_LightmapFlags: 5
|
m_LightmapFlags: 5
|
||||||
m_EnableInstancingVariants: 0
|
m_EnableInstancingVariants: 0
|
||||||
m_DoubleSidedGI: 0
|
m_DoubleSidedGI: 0
|
||||||
@ -32,14 +35,14 @@ Material:
|
|||||||
m_Scale: {x: 1, y: 1}
|
m_Scale: {x: 1, y: 1}
|
||||||
m_Offset: {x: 0, y: 0}
|
m_Offset: {x: 0, y: 0}
|
||||||
- _MainTex:
|
- _MainTex:
|
||||||
m_Texture: {fileID: 28684132378477856, guid: 8f586378b4e144a9851e7b34d9b748ee,
|
m_Texture: {fileID: 28684132378477856, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||||
type: 2}
|
|
||||||
m_Scale: {x: 1, y: 1}
|
m_Scale: {x: 1, y: 1}
|
||||||
m_Offset: {x: 0, y: 0}
|
m_Offset: {x: 0, y: 0}
|
||||||
- _OutlineTex:
|
- _OutlineTex:
|
||||||
m_Texture: {fileID: 0}
|
m_Texture: {fileID: 0}
|
||||||
m_Scale: {x: 1, y: 1}
|
m_Scale: {x: 1, y: 1}
|
||||||
m_Offset: {x: 0, y: 0}
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_Ints: []
|
||||||
m_Floats:
|
m_Floats:
|
||||||
- _Ambient: 0.5
|
- _Ambient: 0.5
|
||||||
- _Bevel: 0.5
|
- _Bevel: 0.5
|
||||||
@ -50,6 +53,7 @@ Material:
|
|||||||
- _BumpFace: 0
|
- _BumpFace: 0
|
||||||
- _BumpOutline: 0
|
- _BumpOutline: 0
|
||||||
- _ColorMask: 15
|
- _ColorMask: 15
|
||||||
|
- _CullMode: 0
|
||||||
- _Diffuse: 0.5
|
- _Diffuse: 0.5
|
||||||
- _DiffusePower: 1
|
- _DiffusePower: 1
|
||||||
- _FaceDilate: 0.1
|
- _FaceDilate: 0.1
|
||||||
@ -71,7 +75,7 @@ Material:
|
|||||||
- _Reflectivity: 10
|
- _Reflectivity: 10
|
||||||
- _ScaleRatioA: 0.9
|
- _ScaleRatioA: 0.9
|
||||||
- _ScaleRatioB: 0.73125
|
- _ScaleRatioB: 0.73125
|
||||||
- _ScaleRatioC: 0.64125
|
- _ScaleRatioC: 0.6107143
|
||||||
- _ScaleX: 1
|
- _ScaleX: 1
|
||||||
- _ScaleY: 1
|
- _ScaleY: 1
|
||||||
- _ShaderFlags: 0
|
- _ShaderFlags: 0
|
||||||
@ -85,8 +89,8 @@ Material:
|
|||||||
- _TextureHeight: 1024
|
- _TextureHeight: 1024
|
||||||
- _TextureWidth: 1024
|
- _TextureWidth: 1024
|
||||||
- _UnderlayDilate: 0
|
- _UnderlayDilate: 0
|
||||||
- _UnderlayOffsetX: 0.5
|
- _UnderlayOffsetX: 1
|
||||||
- _UnderlayOffsetY: -0.5
|
- _UnderlayOffsetY: -1
|
||||||
- _UnderlaySoftness: 0.05
|
- _UnderlaySoftness: 0.05
|
||||||
- _VertexOffsetX: 0
|
- _VertexOffsetX: 0
|
||||||
- _VertexOffsetY: 0
|
- _VertexOffsetY: 0
|
||||||
@ -104,3 +108,4 @@ Material:
|
|||||||
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
|
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
|
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
|
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
|
||||||
|
m_BuildTextureStacks: []
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user