mirror of
https://github.com/PashaBibko/The-Mobius-Line.git
synced 2026-04-03 17:39:03 +00:00
Added main menu
This commit is contained in:
@@ -97,7 +97,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 5cfd42fc2ed2f504dae2b9e7095401cf, type: 3}
|
m_Script: {fileID: 11500000, guid: 5cfd42fc2ed2f504dae2b9e7095401cf, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Sensitivity: {x: 1200, y: 800}
|
m_Sensitivity: {x: 12, y: 8}
|
||||||
m_MaxAngle: 85
|
m_MaxAngle: 85
|
||||||
m_Orientation: {fileID: 0}
|
m_Orientation: {fileID: 0}
|
||||||
m_Tracking: {fileID: 0}
|
m_Tracking: {fileID: 0}
|
||||||
|
|||||||
2494
Assets/Scenes/MainMenu.unity
Normal file
2494
Assets/Scenes/MainMenu.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Scenes/MainMenu.unity.meta
Normal file
7
Assets/Scenes/MainMenu.unity.meta
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e22ef2f7c91cf3c4c9aff93d62cc2f5b
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -58,8 +58,8 @@ public class CameraController : MonoBehaviour
|
|||||||
// Gets the mouse input from the user
|
// Gets the mouse input from the user
|
||||||
Vector2 mouse = new Vector2
|
Vector2 mouse = new Vector2
|
||||||
(
|
(
|
||||||
Input.GetAxisRaw("Mouse X") * Time.deltaTime * m_Sensitivity.x,
|
Input.GetAxisRaw("Mouse X") * Time.deltaTime * m_Sensitivity.x * MainMenu.sens,
|
||||||
Input.GetAxisRaw("Mouse Y") * Time.deltaTime * m_Sensitivity.y
|
Input.GetAxisRaw("Mouse Y") * Time.deltaTime * m_Sensitivity.y * MainMenu.sens
|
||||||
);
|
);
|
||||||
|
|
||||||
// Applies the mouse movement to the camera angle
|
// Applies the mouse movement to the camera angle
|
||||||
|
|||||||
8
Assets/Scripts/UI.meta
Normal file
8
Assets/Scripts/UI.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: af65e72fa15f06447a658f311edb101d
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
66
Assets/Scripts/UI/MainMenu.cs
Normal file
66
Assets/Scripts/UI/MainMenu.cs
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class MainMenu : MonoBehaviour
|
||||||
|
{
|
||||||
|
[Header("Settings")]
|
||||||
|
[SerializeField] int m_TransitionFrames;
|
||||||
|
|
||||||
|
[Header("References")]
|
||||||
|
[SerializeField] Camera m_Camera;
|
||||||
|
|
||||||
|
[Header("Canvases")]
|
||||||
|
[SerializeField] Canvas m_StartCanvas;
|
||||||
|
[SerializeField] Canvas m_OptionsCanvas;
|
||||||
|
[SerializeField] Canvas m_ControlsCanvas;
|
||||||
|
|
||||||
|
[Header("Options References")]
|
||||||
|
[SerializeField] Text m_SensText;
|
||||||
|
[SerializeField] Slider m_SensitivitySlider;
|
||||||
|
|
||||||
|
public static float sens = 100.0f;
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
m_StartCanvas.enabled = true;
|
||||||
|
|
||||||
|
m_ControlsCanvas.enabled = false;
|
||||||
|
m_OptionsCanvas.enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StartGame() => SceneManager.LoadScene(1);
|
||||||
|
public void OptionsMenu()
|
||||||
|
{
|
||||||
|
m_StartCanvas.enabled = false;
|
||||||
|
m_ControlsCanvas.enabled = false;
|
||||||
|
|
||||||
|
m_OptionsCanvas.enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ControlsMenu()
|
||||||
|
{
|
||||||
|
m_StartCanvas.enabled = false;
|
||||||
|
m_OptionsCanvas.enabled = false;
|
||||||
|
|
||||||
|
m_ControlsCanvas.enabled = true;
|
||||||
|
}
|
||||||
|
public void StartMenu()
|
||||||
|
{
|
||||||
|
m_ControlsCanvas.enabled = false;
|
||||||
|
m_OptionsCanvas.enabled = false;
|
||||||
|
|
||||||
|
m_StartCanvas.enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (Input.GetKey(KeyCode.Escape))
|
||||||
|
{
|
||||||
|
StartMenu();
|
||||||
|
}
|
||||||
|
|
||||||
|
sens = m_SensitivitySlider.value;
|
||||||
|
m_SensText.text = sens.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/UI/MainMenu.cs.meta
Normal file
11
Assets/Scripts/UI/MainMenu.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a1feb454d15b4714f9e36e541f9eaca7
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.collab-proxy": "2.7.1",
|
"com.unity.collab-proxy": "2.7.1",
|
||||||
"com.unity.feature.development": "1.0.1",
|
"com.unity.feature.development": "1.0.1",
|
||||||
|
"com.unity.postprocessing": "3.4.0",
|
||||||
"com.unity.probuilder": "5.2.4",
|
"com.unity.probuilder": "5.2.4",
|
||||||
"com.unity.textmeshpro": "3.0.6",
|
"com.unity.textmeshpro": "3.0.6",
|
||||||
"com.unity.timeline": "1.7.6",
|
"com.unity.timeline": "1.7.6",
|
||||||
|
|||||||
@@ -67,6 +67,15 @@
|
|||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
|
"com.unity.postprocessing": {
|
||||||
|
"version": "3.4.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.physics": "1.0.0"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
"com.unity.probuilder": {
|
"com.unity.probuilder": {
|
||||||
"version": "5.2.4",
|
"version": "5.2.4",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ EditorBuildSettings:
|
|||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Scenes:
|
m_Scenes:
|
||||||
|
- enabled: 1
|
||||||
|
path: Assets/Scenes/MainMenu.unity
|
||||||
|
guid: e22ef2f7c91cf3c4c9aff93d62cc2f5b
|
||||||
- enabled: 1
|
- enabled: 1
|
||||||
path: Assets/Scenes/ActualLevel1.unity
|
path: Assets/Scenes/ActualLevel1.unity
|
||||||
guid: 4c98b5cb307000847b781a1a2cda472e
|
guid: 4c98b5cb307000847b781a1a2cda472e
|
||||||
|
|||||||
@@ -834,7 +834,20 @@ PlayerSettings:
|
|||||||
webGLMemoryGeometricGrowthStep: 0.2
|
webGLMemoryGeometricGrowthStep: 0.2
|
||||||
webGLMemoryGeometricGrowthCap: 96
|
webGLMemoryGeometricGrowthCap: 96
|
||||||
webGLPowerPreference: 2
|
webGLPowerPreference: 2
|
||||||
scriptingDefineSymbols: {}
|
scriptingDefineSymbols:
|
||||||
|
Android: UNITY_POST_PROCESSING_STACK_V2
|
||||||
|
EmbeddedLinux: UNITY_POST_PROCESSING_STACK_V2
|
||||||
|
GameCoreXboxOne: UNITY_POST_PROCESSING_STACK_V2
|
||||||
|
Nintendo Switch: UNITY_POST_PROCESSING_STACK_V2
|
||||||
|
PS4: UNITY_POST_PROCESSING_STACK_V2
|
||||||
|
PS5: UNITY_POST_PROCESSING_STACK_V2
|
||||||
|
QNX: UNITY_POST_PROCESSING_STACK_V2
|
||||||
|
Stadia: UNITY_POST_PROCESSING_STACK_V2
|
||||||
|
Standalone: UNITY_POST_PROCESSING_STACK_V2
|
||||||
|
VisionOS: UNITY_POST_PROCESSING_STACK_V2
|
||||||
|
WebGL: UNITY_POST_PROCESSING_STACK_V2
|
||||||
|
XboxOne: UNITY_POST_PROCESSING_STACK_V2
|
||||||
|
tvOS: UNITY_POST_PROCESSING_STACK_V2
|
||||||
additionalCompilerArguments: {}
|
additionalCompilerArguments: {}
|
||||||
platformArchitecture: {}
|
platformArchitecture: {}
|
||||||
scriptingBackend: {}
|
scriptingBackend: {}
|
||||||
|
|||||||
Reference in New Issue
Block a user