Переписал скрипты Restart и BackToMenu, Настроил управление, изменил меню
This commit is contained in:
parent
72950b2600
commit
f5a594d323
@ -2,6 +2,7 @@ using TMPro;
|
|||||||
using Unity.VisualScripting;
|
using Unity.VisualScripting;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.InputSystem;
|
using UnityEngine.InputSystem;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -9,12 +10,17 @@ class Finish : MonoBehaviour
|
|||||||
{
|
{
|
||||||
[SerializeField] private GameObject Effects1;
|
[SerializeField] private GameObject Effects1;
|
||||||
[SerializeField] private GameObject Effects2;
|
[SerializeField] private GameObject Effects2;
|
||||||
[SerializeField] private GameObject WinMenu;
|
|
||||||
[SerializeField] private PlayerInput Player1_Input;
|
[SerializeField] private PlayerInput Player1_Input;
|
||||||
[SerializeField] private PlayerInput Player2_Input;
|
[SerializeField] private PlayerInput Player2_Input;
|
||||||
|
|
||||||
|
[SerializeField] private GameObject WinMenu;
|
||||||
|
[SerializeField] private Button SelectedButton;
|
||||||
[SerializeField] private TextMeshProUGUI WinText;
|
[SerializeField] private TextMeshProUGUI WinText;
|
||||||
|
|
||||||
[SerializeField] private GameObject StripeActive;
|
[SerializeField] private GameObject StripeActive;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
WinMenu.SetActive(false);
|
WinMenu.SetActive(false);
|
||||||
@ -60,9 +66,10 @@ class Finish : MonoBehaviour
|
|||||||
Effects1.SetActive(true);
|
Effects1.SetActive(true);
|
||||||
Effects2.SetActive(true);
|
Effects2.SetActive(true);
|
||||||
WinMenu.SetActive(true);
|
WinMenu.SetActive(true);
|
||||||
|
SelectedButton.Select();
|
||||||
|
|
||||||
Player1_Input.enabled = false;
|
Player1_Input.enabled = false;
|
||||||
Player2_Input.enabled = false;
|
Player2_Input.enabled = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,6 +8,6 @@ public class ScriptRestart : MonoBehaviour
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void Restart()
|
public void Restart()
|
||||||
{
|
{
|
||||||
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
|
SceneManager.LoadSceneAsync(SceneManager.GetActiveScene().name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
8
Assets/Racing_Game/Prefabs.meta
Normal file
8
Assets/Racing_Game/Prefabs.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0b32224e57e3eb64e9892562d717ef64
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/Racing_Game/Prefabs/Maps.meta
Normal file
8
Assets/Racing_Game/Prefabs/Maps.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d277f6233b279304cbc93aaa5e50e06f
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/Racing_Game/Prefabs/Maps/1Map.meta
Normal file
8
Assets/Racing_Game/Prefabs/Maps/1Map.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4f456449c3b306341989af7c85c8b38d
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Binary file not shown.
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0cd8157dcfbd7ea4686914e88dd0c837
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/Racing_Game/UI/MapsUI/1Map.meta
Normal file
8
Assets/Racing_Game/UI/MapsUI/1Map.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 90862be0eecf332429f2886f06b7f73d
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
10
Assets/Racing_Game/UI/MapsUI/1Map/BackToMenuScript.cs
Normal file
10
Assets/Racing_Game/UI/MapsUI/1Map/BackToMenuScript.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
public class BackToMenuScript : MonoBehaviour
|
||||||
|
{
|
||||||
|
public void BackToMenu()
|
||||||
|
{
|
||||||
|
SceneManager.LoadSceneAsync(0);
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Racing_Game/UI/MapsUI/1Map/BackToMenuScript.cs.meta
Normal file
11
Assets/Racing_Game/UI/MapsUI/1Map/BackToMenuScript.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a6cf4a93e5b573347b5c8bab985edd59
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
10
Assets/Racing_Game/UI/MapsUI/1Map/RestartScript.cs
Normal file
10
Assets/Racing_Game/UI/MapsUI/1Map/RestartScript.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
public class RestartScript : MonoBehaviour
|
||||||
|
{
|
||||||
|
public void Restart()
|
||||||
|
{
|
||||||
|
SceneManager.LoadSceneAsync(SceneManager.GetActiveScene().name);
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Racing_Game/UI/MapsUI/1Map/RestartScript.cs.meta
Normal file
11
Assets/Racing_Game/UI/MapsUI/1Map/RestartScript.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e7c8fcb910efd4748877f85f86b6bb94
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -86,7 +86,40 @@
|
|||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "gamepads",
|
"name": "Keyboard",
|
||||||
|
"id": "9194693b-7c4f-425d-8c96-f54db1eca8b7",
|
||||||
|
"path": "1DAxis",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "Throttle",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "negative",
|
||||||
|
"id": "6c933367-c71d-44dd-abf8-0f71205c4259",
|
||||||
|
"path": "<Keyboard>/s",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Keyboard",
|
||||||
|
"action": "Throttle",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "positive",
|
||||||
|
"id": "14950296-ddfa-45da-a8a1-841dc23e7bed",
|
||||||
|
"path": "<Keyboard>/w",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Keyboard",
|
||||||
|
"action": "Throttle",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Gamepad",
|
||||||
"id": "890eb4a4-7dfa-423d-b9dd-a5ba330c7482",
|
"id": "890eb4a4-7dfa-423d-b9dd-a5ba330c7482",
|
||||||
"path": "2DVector",
|
"path": "2DVector",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
@ -102,7 +135,7 @@
|
|||||||
"path": "<Gamepad>/leftStick/left",
|
"path": "<Gamepad>/leftStick/left",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": "",
|
"groups": "Gamepad",
|
||||||
"action": "Steering",
|
"action": "Steering",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
@ -119,7 +152,40 @@
|
|||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "1D Axis",
|
"name": "Keyboard",
|
||||||
|
"id": "2b119774-42e0-4af7-a6d0-f80ab7a1d792",
|
||||||
|
"path": "2DVector",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "Steering",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "left",
|
||||||
|
"id": "c4725932-bf77-49b4-ae6a-f2a821af74f3",
|
||||||
|
"path": "<Keyboard>/a",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Keyboard",
|
||||||
|
"action": "Steering",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "right",
|
||||||
|
"id": "7982cd98-2174-4ba5-9336-86444014708c",
|
||||||
|
"path": "<Keyboard>/d",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Keyboard",
|
||||||
|
"action": "Steering",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Gamepad",
|
||||||
"id": "7f8ea85c-3a52-47e3-865f-5f276f15d11b",
|
"id": "7f8ea85c-3a52-47e3-865f-5f276f15d11b",
|
||||||
"path": "1DAxis(minValue=0)",
|
"path": "1DAxis(minValue=0)",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
@ -135,7 +201,7 @@
|
|||||||
"path": "",
|
"path": "",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": "",
|
"groups": "Gamepad",
|
||||||
"action": "Handbrake",
|
"action": "Handbrake",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
@ -151,6 +217,39 @@
|
|||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Keyboard",
|
||||||
|
"id": "d3e19a7d-ec2e-4908-bcfc-10ed6149e97a",
|
||||||
|
"path": "1DAxis",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "Handbrake",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "negative",
|
||||||
|
"id": "c59d61e7-3a15-439d-87fa-8a59b5fe6437",
|
||||||
|
"path": "",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Keyboard",
|
||||||
|
"action": "Handbrake",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "positive",
|
||||||
|
"id": "422064e0-3113-4666-b205-973375de75e0",
|
||||||
|
"path": "<Keyboard>/space",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Keyboard",
|
||||||
|
"action": "Handbrake",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Gamepad",
|
"name": "Gamepad",
|
||||||
"id": "14b1e5bd-e2a3-43d4-ace6-679f8a78c59c",
|
"id": "14b1e5bd-e2a3-43d4-ace6-679f8a78c59c",
|
||||||
@ -168,7 +267,7 @@
|
|||||||
"path": "",
|
"path": "",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": "",
|
"groups": "Gamepad",
|
||||||
"action": "NOS",
|
"action": "NOS",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
@ -184,6 +283,39 @@
|
|||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Keyboard",
|
||||||
|
"id": "57f4b081-cb98-4eb6-86ce-546b71291040",
|
||||||
|
"path": "1DAxis",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "NOS",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "negative",
|
||||||
|
"id": "b78718e4-3099-4c95-bccc-023c98eae17d",
|
||||||
|
"path": "",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Keyboard",
|
||||||
|
"action": "NOS",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "positive",
|
||||||
|
"id": "ccc60a83-d82a-46f0-8cff-8010f269dbe4",
|
||||||
|
"path": "<Keyboard>/leftShift",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Keyboard",
|
||||||
|
"action": "NOS",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "",
|
"name": "",
|
||||||
"id": "4d4b1ec5-f611-47d6-a6d3-f6d3ac447c79",
|
"id": "4d4b1ec5-f611-47d6-a6d3-f6d3ac447c79",
|
||||||
@ -194,6 +326,17 @@
|
|||||||
"action": "Menu",
|
"action": "Menu",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": false
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "efa8503e-718f-4af5-88c0-6f866190c68e",
|
||||||
|
"path": "<Keyboard>/escape",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Keyboard",
|
||||||
|
"action": "Menu",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -209,6 +352,17 @@
|
|||||||
"isOR": false
|
"isOR": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Keyboard",
|
||||||
|
"bindingGroup": "Keyboard",
|
||||||
|
"devices": [
|
||||||
|
{
|
||||||
|
"devicePath": "<Keyboard>",
|
||||||
|
"isOptional": false,
|
||||||
|
"isOR": false
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user