pause menu and mute
This commit is contained in:
parent
ea42cf24ea
commit
3a52b75bd6
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
768
Assets/PlayerInputScheme.cs
Normal file
768
Assets/PlayerInputScheme.cs
Normal file
|
|
@ -0,0 +1,768 @@
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
||||||
|
// version 1.7.0
|
||||||
|
// from Assets/PlayerInputScheme.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 @PlayerInputScheme: IInputActionCollection2, IDisposable
|
||||||
|
{
|
||||||
|
public InputActionAsset asset { get; }
|
||||||
|
public @PlayerInputScheme()
|
||||||
|
{
|
||||||
|
asset = InputActionAsset.FromJson(@"{
|
||||||
|
""name"": ""PlayerInputScheme"",
|
||||||
|
""maps"": [
|
||||||
|
{
|
||||||
|
""name"": ""Car"",
|
||||||
|
""id"": ""0edeaead-1488-4e62-8532-c64042d99363"",
|
||||||
|
""actions"": [
|
||||||
|
{
|
||||||
|
""name"": ""forward"",
|
||||||
|
""type"": ""Value"",
|
||||||
|
""id"": ""b0192cdc-7e7a-4211-b682-d0cbdd84cac1"",
|
||||||
|
""expectedControlType"": ""Axis"",
|
||||||
|
""processors"": """",
|
||||||
|
""interactions"": """",
|
||||||
|
""initialStateCheck"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""horizontal"",
|
||||||
|
""type"": ""Button"",
|
||||||
|
""id"": ""b9cef62b-33c8-42c0-a5ea-9f128ac13581"",
|
||||||
|
""expectedControlType"": ""Button"",
|
||||||
|
""processors"": """",
|
||||||
|
""interactions"": """",
|
||||||
|
""initialStateCheck"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""pause"",
|
||||||
|
""type"": ""Button"",
|
||||||
|
""id"": ""4d23d26f-1cea-49d8-ab1e-dda345b62986"",
|
||||||
|
""expectedControlType"": ""Button"",
|
||||||
|
""processors"": """",
|
||||||
|
""interactions"": """",
|
||||||
|
""initialStateCheck"": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
""bindings"": [
|
||||||
|
{
|
||||||
|
""name"": ""gamepad"",
|
||||||
|
""id"": ""87db7e9f-45c3-4263-b97c-3049f58ac197"",
|
||||||
|
""path"": ""1DAxis"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""forward"",
|
||||||
|
""isComposite"": true,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""negative"",
|
||||||
|
""id"": ""ebd45df9-ddfd-42e7-9e8c-51f8459a10b3"",
|
||||||
|
""path"": ""<Gamepad>/leftTrigger"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": ""Default"",
|
||||||
|
""action"": ""forward"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""positive"",
|
||||||
|
""id"": ""8fab3cca-fea9-4bcf-97ae-6787a1c5b45b"",
|
||||||
|
""path"": ""<Gamepad>/rightTrigger"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": ""Default"",
|
||||||
|
""action"": ""forward"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""wasd"",
|
||||||
|
""id"": ""b0501139-ead2-4fb6-9986-34c712fdae6f"",
|
||||||
|
""path"": ""1DAxis"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""forward"",
|
||||||
|
""isComposite"": true,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""positive"",
|
||||||
|
""id"": ""af2c0802-11b3-4cb5-bccb-e5349504c2b9"",
|
||||||
|
""path"": ""<Keyboard>/#(W)"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": ""Default"",
|
||||||
|
""action"": ""forward"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""negative"",
|
||||||
|
""id"": ""70ebcaf8-15a4-44fa-929a-670c612916e4"",
|
||||||
|
""path"": ""<Keyboard>/s"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": ""Default"",
|
||||||
|
""action"": ""forward"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""arrows"",
|
||||||
|
""id"": ""0c0f55f2-bb23-45a1-a532-35dbf2704bde"",
|
||||||
|
""path"": ""1DAxis"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""forward"",
|
||||||
|
""isComposite"": true,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""positive"",
|
||||||
|
""id"": ""6091448d-1343-4692-b504-a1d12580271b"",
|
||||||
|
""path"": ""<Keyboard>/upArrow"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": ""Default"",
|
||||||
|
""action"": ""forward"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""negative"",
|
||||||
|
""id"": ""730119a2-61bc-4b96-a80e-ea099f12d194"",
|
||||||
|
""path"": ""<Keyboard>/downArrow"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": ""Default"",
|
||||||
|
""action"": ""forward"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""gamepad"",
|
||||||
|
""id"": ""fb51e1f5-f210-4203-ac79-4b00c7277ba9"",
|
||||||
|
""path"": ""1DAxis"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": true,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""negative"",
|
||||||
|
""id"": ""c3e295d7-319e-4a3c-abff-170643840503"",
|
||||||
|
""path"": ""<Gamepad>/leftStick/left"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": ""Default"",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""positive"",
|
||||||
|
""id"": ""cbadf142-560c-4e1d-a094-579f19237611"",
|
||||||
|
""path"": ""<Gamepad>/leftStick/right"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": ""Default"",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""wasd"",
|
||||||
|
""id"": ""c4418974-48ea-4584-802b-f949e8ce7871"",
|
||||||
|
""path"": ""1DAxis"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": true,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""negative"",
|
||||||
|
""id"": ""a3d4156a-4fb8-485c-ad97-7be9e2c9cf1d"",
|
||||||
|
""path"": ""<Keyboard>/d"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": ""Default"",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""positive"",
|
||||||
|
""id"": ""fc22a802-f80b-4079-b7ae-2f8958fb3978"",
|
||||||
|
""path"": ""<Keyboard>/a"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": ""Default"",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""arrows"",
|
||||||
|
""id"": ""666c9183-e944-409d-92bf-54a77f1807e6"",
|
||||||
|
""path"": ""1DAxis"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": true,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""negative"",
|
||||||
|
""id"": ""d3ac4e8f-2a4c-422c-8b86-ad5edc214ce3"",
|
||||||
|
""path"": ""<Keyboard>/leftArrow"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": ""Default"",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""positive"",
|
||||||
|
""id"": ""80625c99-89cc-4371-b13a-363d31a5aa7e"",
|
||||||
|
""path"": ""<Keyboard>/rightArrow"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": ""Default"",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": """",
|
||||||
|
""id"": ""9f511f57-7eab-4ca4-9a68-c7a15feff433"",
|
||||||
|
""path"": ""<Keyboard>/pause"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""pause"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": """",
|
||||||
|
""id"": ""ba7bd1a3-ea64-40ee-a8cb-aeb0c4704f75"",
|
||||||
|
""path"": ""<Keyboard>/escape"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""pause"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": """",
|
||||||
|
""id"": ""167c1b89-c2ac-4971-86ff-79d7d4893482"",
|
||||||
|
""path"": ""<Gamepad>/start"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""pause"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""UI"",
|
||||||
|
""id"": ""17fa73e4-4369-4161-9e95-1d6965261105"",
|
||||||
|
""actions"": [
|
||||||
|
{
|
||||||
|
""name"": ""vertical"",
|
||||||
|
""type"": ""Button"",
|
||||||
|
""id"": ""1978676c-2048-4d41-b081-aee1ca80faa3"",
|
||||||
|
""expectedControlType"": ""Button"",
|
||||||
|
""processors"": """",
|
||||||
|
""interactions"": """",
|
||||||
|
""initialStateCheck"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""horizontal"",
|
||||||
|
""type"": ""Button"",
|
||||||
|
""id"": ""ce783541-1b27-49d1-b78a-372e9dedeacf"",
|
||||||
|
""expectedControlType"": ""Button"",
|
||||||
|
""processors"": """",
|
||||||
|
""interactions"": """",
|
||||||
|
""initialStateCheck"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""select"",
|
||||||
|
""type"": ""Button"",
|
||||||
|
""id"": ""dccad7a3-64eb-4f32-b263-77aa6b02c3d1"",
|
||||||
|
""expectedControlType"": ""Button"",
|
||||||
|
""processors"": """",
|
||||||
|
""interactions"": """",
|
||||||
|
""initialStateCheck"": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
""bindings"": [
|
||||||
|
{
|
||||||
|
""name"": ""keyboard"",
|
||||||
|
""id"": ""c1806658-f420-4a2d-b8c8-ef0fb8416f9c"",
|
||||||
|
""path"": ""1DAxis"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""vertical"",
|
||||||
|
""isComposite"": true,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""negative"",
|
||||||
|
""id"": ""2c57ff20-a6b6-4cf4-bcd2-64bde9411d86"",
|
||||||
|
""path"": ""<Keyboard>/downArrow"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""vertical"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""positive"",
|
||||||
|
""id"": ""a5482a2d-ab63-4589-90b7-9dc7ebb26256"",
|
||||||
|
""path"": ""<Keyboard>/upArrow"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""vertical"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""gamepadDpad"",
|
||||||
|
""id"": ""52321a42-8393-41b8-87aa-248d1df1c04c"",
|
||||||
|
""path"": ""1DAxis"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""vertical"",
|
||||||
|
""isComposite"": true,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""negative"",
|
||||||
|
""id"": ""0d3d73c3-bd11-4717-88f9-fae69b178ccd"",
|
||||||
|
""path"": ""<Gamepad>/dpad/down"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""vertical"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""positive"",
|
||||||
|
""id"": ""4fdbcd9b-bff7-4a45-90a7-9d7d3c275c0d"",
|
||||||
|
""path"": ""<Gamepad>/dpad/up"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""vertical"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""gamepad"",
|
||||||
|
""id"": ""4d76320a-02c7-42ee-8cf8-8e18118b1c76"",
|
||||||
|
""path"": ""1DAxis"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""vertical"",
|
||||||
|
""isComposite"": true,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""negative"",
|
||||||
|
""id"": ""937d80f8-432b-47a5-b8b1-f20de3abf4db"",
|
||||||
|
""path"": ""<Gamepad>/leftStick/down"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""vertical"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""positive"",
|
||||||
|
""id"": ""8fc41c3a-7104-4621-a0e6-184a64dc7610"",
|
||||||
|
""path"": ""<Gamepad>/leftStick/up"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""vertical"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": """",
|
||||||
|
""id"": ""4da991a2-76cb-4259-9d87-9d1f795a55b5"",
|
||||||
|
""path"": ""<Keyboard>/enter"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""select"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": """",
|
||||||
|
""id"": ""372985da-b26c-474a-9be0-8e1052d81b9b"",
|
||||||
|
""path"": ""<Gamepad>/buttonSouth"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""select"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""keyboard"",
|
||||||
|
""id"": ""4f48ed55-c841-4c13-bef6-f9082e870143"",
|
||||||
|
""path"": ""1DAxis"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": true,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""negative"",
|
||||||
|
""id"": ""5a27f78f-b4c2-4271-8e81-3502dece99be"",
|
||||||
|
""path"": ""<Keyboard>/leftArrow"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""positive"",
|
||||||
|
""id"": ""11d6fc86-7f0b-4f81-9dbf-9278c4771f10"",
|
||||||
|
""path"": ""<Keyboard>/rightArrow"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""gamepadDpad"",
|
||||||
|
""id"": ""8d710f71-579e-4fe2-98a6-cba45962c82d"",
|
||||||
|
""path"": ""1DAxis"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": true,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""negative"",
|
||||||
|
""id"": ""0ea6d986-8c31-4a9e-abfb-440a4a866c38"",
|
||||||
|
""path"": ""<Gamepad>/dpad/left"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""positive"",
|
||||||
|
""id"": ""b7ad09e9-547c-444b-99f8-134a3e239403"",
|
||||||
|
""path"": ""<Gamepad>/dpad/left"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""gamepad"",
|
||||||
|
""id"": ""a887bb21-d837-4488-adde-ff11f36155bb"",
|
||||||
|
""path"": ""1DAxis"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": true,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""negative"",
|
||||||
|
""id"": ""16708654-a9fd-4285-9a74-fe6664462615"",
|
||||||
|
""path"": ""<Gamepad>/leftStick/left"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""positive"",
|
||||||
|
""id"": ""200102e2-9791-404a-874f-623ed1072a82"",
|
||||||
|
""path"": ""<Gamepad>/leftStick/right"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""horizontal"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
""controlSchemes"": [
|
||||||
|
{
|
||||||
|
""name"": ""Default"",
|
||||||
|
""bindingGroup"": ""Default"",
|
||||||
|
""devices"": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}");
|
||||||
|
// Car
|
||||||
|
m_Car = asset.FindActionMap("Car", throwIfNotFound: true);
|
||||||
|
m_Car_forward = m_Car.FindAction("forward", throwIfNotFound: true);
|
||||||
|
m_Car_horizontal = m_Car.FindAction("horizontal", throwIfNotFound: true);
|
||||||
|
m_Car_pause = m_Car.FindAction("pause", throwIfNotFound: true);
|
||||||
|
// UI
|
||||||
|
m_UI = asset.FindActionMap("UI", throwIfNotFound: true);
|
||||||
|
m_UI_vertical = m_UI.FindAction("vertical", throwIfNotFound: true);
|
||||||
|
m_UI_horizontal = m_UI.FindAction("horizontal", throwIfNotFound: true);
|
||||||
|
m_UI_select = m_UI.FindAction("select", 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Car
|
||||||
|
private readonly InputActionMap m_Car;
|
||||||
|
private List<ICarActions> m_CarActionsCallbackInterfaces = new List<ICarActions>();
|
||||||
|
private readonly InputAction m_Car_forward;
|
||||||
|
private readonly InputAction m_Car_horizontal;
|
||||||
|
private readonly InputAction m_Car_pause;
|
||||||
|
public struct CarActions
|
||||||
|
{
|
||||||
|
private @PlayerInputScheme m_Wrapper;
|
||||||
|
public CarActions(@PlayerInputScheme wrapper) { m_Wrapper = wrapper; }
|
||||||
|
public InputAction @forward => m_Wrapper.m_Car_forward;
|
||||||
|
public InputAction @horizontal => m_Wrapper.m_Car_horizontal;
|
||||||
|
public InputAction @pause => m_Wrapper.m_Car_pause;
|
||||||
|
public InputActionMap Get() { return m_Wrapper.m_Car; }
|
||||||
|
public void Enable() { Get().Enable(); }
|
||||||
|
public void Disable() { Get().Disable(); }
|
||||||
|
public bool enabled => Get().enabled;
|
||||||
|
public static implicit operator InputActionMap(CarActions set) { return set.Get(); }
|
||||||
|
public void AddCallbacks(ICarActions instance)
|
||||||
|
{
|
||||||
|
if (instance == null || m_Wrapper.m_CarActionsCallbackInterfaces.Contains(instance)) return;
|
||||||
|
m_Wrapper.m_CarActionsCallbackInterfaces.Add(instance);
|
||||||
|
@forward.started += instance.OnForward;
|
||||||
|
@forward.performed += instance.OnForward;
|
||||||
|
@forward.canceled += instance.OnForward;
|
||||||
|
@horizontal.started += instance.OnHorizontal;
|
||||||
|
@horizontal.performed += instance.OnHorizontal;
|
||||||
|
@horizontal.canceled += instance.OnHorizontal;
|
||||||
|
@pause.started += instance.OnPause;
|
||||||
|
@pause.performed += instance.OnPause;
|
||||||
|
@pause.canceled += instance.OnPause;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UnregisterCallbacks(ICarActions instance)
|
||||||
|
{
|
||||||
|
@forward.started -= instance.OnForward;
|
||||||
|
@forward.performed -= instance.OnForward;
|
||||||
|
@forward.canceled -= instance.OnForward;
|
||||||
|
@horizontal.started -= instance.OnHorizontal;
|
||||||
|
@horizontal.performed -= instance.OnHorizontal;
|
||||||
|
@horizontal.canceled -= instance.OnHorizontal;
|
||||||
|
@pause.started -= instance.OnPause;
|
||||||
|
@pause.performed -= instance.OnPause;
|
||||||
|
@pause.canceled -= instance.OnPause;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveCallbacks(ICarActions instance)
|
||||||
|
{
|
||||||
|
if (m_Wrapper.m_CarActionsCallbackInterfaces.Remove(instance))
|
||||||
|
UnregisterCallbacks(instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetCallbacks(ICarActions instance)
|
||||||
|
{
|
||||||
|
foreach (var item in m_Wrapper.m_CarActionsCallbackInterfaces)
|
||||||
|
UnregisterCallbacks(item);
|
||||||
|
m_Wrapper.m_CarActionsCallbackInterfaces.Clear();
|
||||||
|
AddCallbacks(instance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public CarActions @Car => new CarActions(this);
|
||||||
|
|
||||||
|
// UI
|
||||||
|
private readonly InputActionMap m_UI;
|
||||||
|
private List<IUIActions> m_UIActionsCallbackInterfaces = new List<IUIActions>();
|
||||||
|
private readonly InputAction m_UI_vertical;
|
||||||
|
private readonly InputAction m_UI_horizontal;
|
||||||
|
private readonly InputAction m_UI_select;
|
||||||
|
public struct UIActions
|
||||||
|
{
|
||||||
|
private @PlayerInputScheme m_Wrapper;
|
||||||
|
public UIActions(@PlayerInputScheme wrapper) { m_Wrapper = wrapper; }
|
||||||
|
public InputAction @vertical => m_Wrapper.m_UI_vertical;
|
||||||
|
public InputAction @horizontal => m_Wrapper.m_UI_horizontal;
|
||||||
|
public InputAction @select => m_Wrapper.m_UI_select;
|
||||||
|
public InputActionMap Get() { return m_Wrapper.m_UI; }
|
||||||
|
public void Enable() { Get().Enable(); }
|
||||||
|
public void Disable() { Get().Disable(); }
|
||||||
|
public bool enabled => Get().enabled;
|
||||||
|
public static implicit operator InputActionMap(UIActions set) { return set.Get(); }
|
||||||
|
public void AddCallbacks(IUIActions instance)
|
||||||
|
{
|
||||||
|
if (instance == null || m_Wrapper.m_UIActionsCallbackInterfaces.Contains(instance)) return;
|
||||||
|
m_Wrapper.m_UIActionsCallbackInterfaces.Add(instance);
|
||||||
|
@vertical.started += instance.OnVertical;
|
||||||
|
@vertical.performed += instance.OnVertical;
|
||||||
|
@vertical.canceled += instance.OnVertical;
|
||||||
|
@horizontal.started += instance.OnHorizontal;
|
||||||
|
@horizontal.performed += instance.OnHorizontal;
|
||||||
|
@horizontal.canceled += instance.OnHorizontal;
|
||||||
|
@select.started += instance.OnSelect;
|
||||||
|
@select.performed += instance.OnSelect;
|
||||||
|
@select.canceled += instance.OnSelect;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UnregisterCallbacks(IUIActions instance)
|
||||||
|
{
|
||||||
|
@vertical.started -= instance.OnVertical;
|
||||||
|
@vertical.performed -= instance.OnVertical;
|
||||||
|
@vertical.canceled -= instance.OnVertical;
|
||||||
|
@horizontal.started -= instance.OnHorizontal;
|
||||||
|
@horizontal.performed -= instance.OnHorizontal;
|
||||||
|
@horizontal.canceled -= instance.OnHorizontal;
|
||||||
|
@select.started -= instance.OnSelect;
|
||||||
|
@select.performed -= instance.OnSelect;
|
||||||
|
@select.canceled -= instance.OnSelect;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveCallbacks(IUIActions instance)
|
||||||
|
{
|
||||||
|
if (m_Wrapper.m_UIActionsCallbackInterfaces.Remove(instance))
|
||||||
|
UnregisterCallbacks(instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetCallbacks(IUIActions instance)
|
||||||
|
{
|
||||||
|
foreach (var item in m_Wrapper.m_UIActionsCallbackInterfaces)
|
||||||
|
UnregisterCallbacks(item);
|
||||||
|
m_Wrapper.m_UIActionsCallbackInterfaces.Clear();
|
||||||
|
AddCallbacks(instance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public UIActions @UI => new UIActions(this);
|
||||||
|
private int m_DefaultSchemeIndex = -1;
|
||||||
|
public InputControlScheme DefaultScheme
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (m_DefaultSchemeIndex == -1) m_DefaultSchemeIndex = asset.FindControlSchemeIndex("Default");
|
||||||
|
return asset.controlSchemes[m_DefaultSchemeIndex];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public interface ICarActions
|
||||||
|
{
|
||||||
|
void OnForward(InputAction.CallbackContext context);
|
||||||
|
void OnHorizontal(InputAction.CallbackContext context);
|
||||||
|
void OnPause(InputAction.CallbackContext context);
|
||||||
|
}
|
||||||
|
public interface IUIActions
|
||||||
|
{
|
||||||
|
void OnVertical(InputAction.CallbackContext context);
|
||||||
|
void OnHorizontal(InputAction.CallbackContext context);
|
||||||
|
void OnSelect(InputAction.CallbackContext context);
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/PlayerInputScheme.cs.meta
Normal file
11
Assets/PlayerInputScheme.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e69414b943c00b240a07e92d9299652f
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
533
Assets/PlayerInputScheme.inputactions
Normal file
533
Assets/PlayerInputScheme.inputactions
Normal file
|
|
@ -0,0 +1,533 @@
|
||||||
|
{
|
||||||
|
"name": "PlayerInputScheme",
|
||||||
|
"maps": [
|
||||||
|
{
|
||||||
|
"name": "Car",
|
||||||
|
"id": "0edeaead-1488-4e62-8532-c64042d99363",
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"name": "forward",
|
||||||
|
"type": "Value",
|
||||||
|
"id": "b0192cdc-7e7a-4211-b682-d0cbdd84cac1",
|
||||||
|
"expectedControlType": "Axis",
|
||||||
|
"processors": "",
|
||||||
|
"interactions": "",
|
||||||
|
"initialStateCheck": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "horizontal",
|
||||||
|
"type": "Button",
|
||||||
|
"id": "b9cef62b-33c8-42c0-a5ea-9f128ac13581",
|
||||||
|
"expectedControlType": "Button",
|
||||||
|
"processors": "",
|
||||||
|
"interactions": "",
|
||||||
|
"initialStateCheck": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "pause",
|
||||||
|
"type": "Button",
|
||||||
|
"id": "4d23d26f-1cea-49d8-ab1e-dda345b62986",
|
||||||
|
"expectedControlType": "Button",
|
||||||
|
"processors": "",
|
||||||
|
"interactions": "",
|
||||||
|
"initialStateCheck": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"bindings": [
|
||||||
|
{
|
||||||
|
"name": "gamepad",
|
||||||
|
"id": "87db7e9f-45c3-4263-b97c-3049f58ac197",
|
||||||
|
"path": "1DAxis",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "forward",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "negative",
|
||||||
|
"id": "ebd45df9-ddfd-42e7-9e8c-51f8459a10b3",
|
||||||
|
"path": "<Gamepad>/leftTrigger",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Default",
|
||||||
|
"action": "forward",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "positive",
|
||||||
|
"id": "8fab3cca-fea9-4bcf-97ae-6787a1c5b45b",
|
||||||
|
"path": "<Gamepad>/rightTrigger",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Default",
|
||||||
|
"action": "forward",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "wasd",
|
||||||
|
"id": "b0501139-ead2-4fb6-9986-34c712fdae6f",
|
||||||
|
"path": "1DAxis",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "forward",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "positive",
|
||||||
|
"id": "af2c0802-11b3-4cb5-bccb-e5349504c2b9",
|
||||||
|
"path": "<Keyboard>/#(W)",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Default",
|
||||||
|
"action": "forward",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "negative",
|
||||||
|
"id": "70ebcaf8-15a4-44fa-929a-670c612916e4",
|
||||||
|
"path": "<Keyboard>/s",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Default",
|
||||||
|
"action": "forward",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "arrows",
|
||||||
|
"id": "0c0f55f2-bb23-45a1-a532-35dbf2704bde",
|
||||||
|
"path": "1DAxis",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "forward",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "positive",
|
||||||
|
"id": "6091448d-1343-4692-b504-a1d12580271b",
|
||||||
|
"path": "<Keyboard>/upArrow",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Default",
|
||||||
|
"action": "forward",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "negative",
|
||||||
|
"id": "730119a2-61bc-4b96-a80e-ea099f12d194",
|
||||||
|
"path": "<Keyboard>/downArrow",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Default",
|
||||||
|
"action": "forward",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gamepad",
|
||||||
|
"id": "fb51e1f5-f210-4203-ac79-4b00c7277ba9",
|
||||||
|
"path": "1DAxis",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "negative",
|
||||||
|
"id": "c3e295d7-319e-4a3c-abff-170643840503",
|
||||||
|
"path": "<Gamepad>/leftStick/left",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Default",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "positive",
|
||||||
|
"id": "cbadf142-560c-4e1d-a094-579f19237611",
|
||||||
|
"path": "<Gamepad>/leftStick/right",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Default",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "wasd",
|
||||||
|
"id": "c4418974-48ea-4584-802b-f949e8ce7871",
|
||||||
|
"path": "1DAxis",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "negative",
|
||||||
|
"id": "a3d4156a-4fb8-485c-ad97-7be9e2c9cf1d",
|
||||||
|
"path": "<Keyboard>/d",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Default",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "positive",
|
||||||
|
"id": "fc22a802-f80b-4079-b7ae-2f8958fb3978",
|
||||||
|
"path": "<Keyboard>/a",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Default",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "arrows",
|
||||||
|
"id": "666c9183-e944-409d-92bf-54a77f1807e6",
|
||||||
|
"path": "1DAxis",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "negative",
|
||||||
|
"id": "d3ac4e8f-2a4c-422c-8b86-ad5edc214ce3",
|
||||||
|
"path": "<Keyboard>/leftArrow",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Default",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "positive",
|
||||||
|
"id": "80625c99-89cc-4371-b13a-363d31a5aa7e",
|
||||||
|
"path": "<Keyboard>/rightArrow",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Default",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "9f511f57-7eab-4ca4-9a68-c7a15feff433",
|
||||||
|
"path": "<Keyboard>/pause",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "pause",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "ba7bd1a3-ea64-40ee-a8cb-aeb0c4704f75",
|
||||||
|
"path": "<Keyboard>/escape",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "pause",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "167c1b89-c2ac-4971-86ff-79d7d4893482",
|
||||||
|
"path": "<Gamepad>/start",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "pause",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "UI",
|
||||||
|
"id": "17fa73e4-4369-4161-9e95-1d6965261105",
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"name": "vertical",
|
||||||
|
"type": "Button",
|
||||||
|
"id": "1978676c-2048-4d41-b081-aee1ca80faa3",
|
||||||
|
"expectedControlType": "Button",
|
||||||
|
"processors": "",
|
||||||
|
"interactions": "",
|
||||||
|
"initialStateCheck": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "horizontal",
|
||||||
|
"type": "Button",
|
||||||
|
"id": "ce783541-1b27-49d1-b78a-372e9dedeacf",
|
||||||
|
"expectedControlType": "Button",
|
||||||
|
"processors": "",
|
||||||
|
"interactions": "",
|
||||||
|
"initialStateCheck": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "select",
|
||||||
|
"type": "Button",
|
||||||
|
"id": "dccad7a3-64eb-4f32-b263-77aa6b02c3d1",
|
||||||
|
"expectedControlType": "Button",
|
||||||
|
"processors": "",
|
||||||
|
"interactions": "",
|
||||||
|
"initialStateCheck": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"bindings": [
|
||||||
|
{
|
||||||
|
"name": "keyboard",
|
||||||
|
"id": "c1806658-f420-4a2d-b8c8-ef0fb8416f9c",
|
||||||
|
"path": "1DAxis",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "vertical",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "negative",
|
||||||
|
"id": "2c57ff20-a6b6-4cf4-bcd2-64bde9411d86",
|
||||||
|
"path": "<Keyboard>/downArrow",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "vertical",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "positive",
|
||||||
|
"id": "a5482a2d-ab63-4589-90b7-9dc7ebb26256",
|
||||||
|
"path": "<Keyboard>/upArrow",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "vertical",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gamepadDpad",
|
||||||
|
"id": "52321a42-8393-41b8-87aa-248d1df1c04c",
|
||||||
|
"path": "1DAxis",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "vertical",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "negative",
|
||||||
|
"id": "0d3d73c3-bd11-4717-88f9-fae69b178ccd",
|
||||||
|
"path": "<Gamepad>/dpad/down",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "vertical",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "positive",
|
||||||
|
"id": "4fdbcd9b-bff7-4a45-90a7-9d7d3c275c0d",
|
||||||
|
"path": "<Gamepad>/dpad/up",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "vertical",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gamepad",
|
||||||
|
"id": "4d76320a-02c7-42ee-8cf8-8e18118b1c76",
|
||||||
|
"path": "1DAxis",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "vertical",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "negative",
|
||||||
|
"id": "937d80f8-432b-47a5-b8b1-f20de3abf4db",
|
||||||
|
"path": "<Gamepad>/leftStick/down",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "vertical",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "positive",
|
||||||
|
"id": "8fc41c3a-7104-4621-a0e6-184a64dc7610",
|
||||||
|
"path": "<Gamepad>/leftStick/up",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "vertical",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "4da991a2-76cb-4259-9d87-9d1f795a55b5",
|
||||||
|
"path": "<Keyboard>/enter",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "select",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "372985da-b26c-474a-9be0-8e1052d81b9b",
|
||||||
|
"path": "<Gamepad>/buttonSouth",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "select",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyboard",
|
||||||
|
"id": "4f48ed55-c841-4c13-bef6-f9082e870143",
|
||||||
|
"path": "1DAxis",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "negative",
|
||||||
|
"id": "5a27f78f-b4c2-4271-8e81-3502dece99be",
|
||||||
|
"path": "<Keyboard>/leftArrow",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "positive",
|
||||||
|
"id": "11d6fc86-7f0b-4f81-9dbf-9278c4771f10",
|
||||||
|
"path": "<Keyboard>/rightArrow",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gamepadDpad",
|
||||||
|
"id": "8d710f71-579e-4fe2-98a6-cba45962c82d",
|
||||||
|
"path": "1DAxis",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "negative",
|
||||||
|
"id": "0ea6d986-8c31-4a9e-abfb-440a4a866c38",
|
||||||
|
"path": "<Gamepad>/dpad/left",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "positive",
|
||||||
|
"id": "b7ad09e9-547c-444b-99f8-134a3e239403",
|
||||||
|
"path": "<Gamepad>/dpad/left",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gamepad",
|
||||||
|
"id": "a887bb21-d837-4488-adde-ff11f36155bb",
|
||||||
|
"path": "1DAxis",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "negative",
|
||||||
|
"id": "16708654-a9fd-4285-9a74-fe6664462615",
|
||||||
|
"path": "<Gamepad>/leftStick/left",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "positive",
|
||||||
|
"id": "200102e2-9791-404a-874f-623ed1072a82",
|
||||||
|
"path": "<Gamepad>/leftStick/right",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "horizontal",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"controlSchemes": [
|
||||||
|
{
|
||||||
|
"name": "Default",
|
||||||
|
"bindingGroup": "Default",
|
||||||
|
"devices": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
14
Assets/PlayerInputScheme.inputactions.meta
Normal file
14
Assets/PlayerInputScheme.inputactions.meta
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b10aaa12422ee4340ba48ffddf0d5106
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3}
|
||||||
|
generateWrapperCode: 1
|
||||||
|
wrapperCodePath:
|
||||||
|
wrapperClassName:
|
||||||
|
wrapperCodeNamespace:
|
||||||
130
Assets/Prefabs/UI/MusicToggle.prefab
Normal file
130
Assets/Prefabs/UI/MusicToggle.prefab
Normal file
|
|
@ -0,0 +1,130 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &2245281500343514197
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 3280052200079396545}
|
||||||
|
- component: {fileID: 3437603835384447558}
|
||||||
|
- component: {fileID: 1994164841774852457}
|
||||||
|
- component: {fileID: 2359324598514542875}
|
||||||
|
- component: {fileID: 2489547913215023354}
|
||||||
|
- component: {fileID: 6528090035859181877}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: MusicToggle
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &3280052200079396545
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2245281500343514197}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchoredPosition: {x: 827.9656, y: -421.14926}
|
||||||
|
m_SizeDelta: {x: 180, y: 180}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &3437603835384447558
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2245281500343514197}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &1994164841774852457
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2245281500343514197}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_Sprite: {fileID: 21300000, guid: 43c3ae58ae942044ca91d43bd3140341, type: 3}
|
||||||
|
m_Type: 0
|
||||||
|
m_PreserveAspect: 0
|
||||||
|
m_FillCenter: 1
|
||||||
|
m_FillMethod: 4
|
||||||
|
m_FillAmount: 1
|
||||||
|
m_FillClockwise: 1
|
||||||
|
m_FillOrigin: 0
|
||||||
|
m_UseSpriteMesh: 0
|
||||||
|
m_PixelsPerUnitMultiplier: 1
|
||||||
|
--- !u!114 &2359324598514542875
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2245281500343514197}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Delegates: []
|
||||||
|
--- !u!114 &2489547913215023354
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2245281500343514197}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 1296525c722dda443885218850647c2a, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_isOn: 1
|
||||||
|
image: {fileID: 1994164841774852457}
|
||||||
|
onColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
offColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||||
|
onSprite: {fileID: 21300000, guid: 43c3ae58ae942044ca91d43bd3140341, type: 3}
|
||||||
|
offSprite: {fileID: 21300000, guid: 042a2506a6f954b44a4e2503f69af705, type: 3}
|
||||||
|
tweenDuration: 0.2
|
||||||
|
tweenEase: 6
|
||||||
|
enabledScale: 1
|
||||||
|
disabledScale: 0.9
|
||||||
|
hoverScale: 1.1
|
||||||
|
--- !u!114 &6528090035859181877
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2245281500343514197}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 90042cdd91b5373459013e3d24db4f3e, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
toggle: {fileID: 2489547913215023354}
|
||||||
|
audioSource: {fileID: 0}
|
||||||
7
Assets/Prefabs/UI/MusicToggle.prefab.meta
Normal file
7
Assets/Prefabs/UI/MusicToggle.prefab.meta
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0b05a2b02a302674d8790b8f19790a9a
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1304,6 +1304,7 @@ RectTransform:
|
||||||
- {fileID: 1474361235}
|
- {fileID: 1474361235}
|
||||||
- {fileID: 691933973}
|
- {fileID: 691933973}
|
||||||
- {fileID: 1647462532}
|
- {fileID: 1647462532}
|
||||||
|
- {fileID: 1458778398}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
|
|
@ -9245,6 +9246,12 @@ Transform:
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!224 &1458778398 stripped
|
||||||
|
RectTransform:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 4350253618716748754}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!1 &1474361234
|
--- !u!1 &1474361234
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -9496,6 +9503,16 @@ MonoBehaviour:
|
||||||
highscorePanel: {fileID: 0}
|
highscorePanel: {fileID: 0}
|
||||||
leaderboardItemsParent: {fileID: 0}
|
leaderboardItemsParent: {fileID: 0}
|
||||||
leaderboardItemPrefab: {fileID: 0}
|
leaderboardItemPrefab: {fileID: 0}
|
||||||
|
pauseMenu: {fileID: 0}
|
||||||
|
pauseAction:
|
||||||
|
m_Name:
|
||||||
|
m_Type: 0
|
||||||
|
m_ExpectedControlType:
|
||||||
|
m_Id: 22a9f407-627d-4184-bf10-6ae7b3bc97fd
|
||||||
|
m_Processors:
|
||||||
|
m_Interactions:
|
||||||
|
m_SingletonActionBindings: []
|
||||||
|
m_Flags: 0
|
||||||
lives: 3
|
lives: 3
|
||||||
--- !u!4 &1498859630
|
--- !u!4 &1498859630
|
||||||
Transform:
|
Transform:
|
||||||
|
|
@ -10547,11 +10564,11 @@ AudioSource:
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 4
|
serializedVersion: 4
|
||||||
OutputAudioMixerGroup: {fileID: 0}
|
OutputAudioMixerGroup: {fileID: 0}
|
||||||
m_audioClip: {fileID: 8300000, guid: b474067d00436bd4599f4115f17df4c7, type: 3}
|
m_audioClip: {fileID: 8300000, guid: 6c19bf6ca1608914183ed9855886cc05, type: 3}
|
||||||
m_PlayOnAwake: 1
|
m_PlayOnAwake: 1
|
||||||
m_Volume: 0.418
|
m_Volume: 0.3
|
||||||
m_Pitch: 1
|
m_Pitch: 1
|
||||||
Loop: 0
|
Loop: 1
|
||||||
Mute: 0
|
Mute: 0
|
||||||
Spatialize: 0
|
Spatialize: 0
|
||||||
SpatializePostEffects: 0
|
SpatializePostEffects: 0
|
||||||
|
|
@ -13594,6 +13611,129 @@ GameObject:
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 1
|
||||||
|
--- !u!1001 &4350253618716748754
|
||||||
|
PrefabInstance:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TransformParent: {fileID: 364260411}
|
||||||
|
m_Modifications:
|
||||||
|
- target: {fileID: 2245281500343514197, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_Name
|
||||||
|
value: MusicToggle
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_Pivot.x
|
||||||
|
value: 0.5
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_Pivot.y
|
||||||
|
value: 0.5
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_AnchorMax.x
|
||||||
|
value: 0.5
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0.5
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_AnchorMin.x
|
||||||
|
value: 0.5
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_AnchorMin.y
|
||||||
|
value: 0.5
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_SizeDelta.x
|
||||||
|
value: 180
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_SizeDelta.y
|
||||||
|
value: 180
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalPosition.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalPosition.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalPosition.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.w
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.x
|
||||||
|
value: 827.9656
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.y
|
||||||
|
value: -421.14926
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3280052200079396545, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6528090035859181877, guid: 0b05a2b02a302674d8790b8f19790a9a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: audioSource
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 1727813820}
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_RemovedGameObjects: []
|
||||||
|
m_AddedGameObjects: []
|
||||||
|
m_AddedComponents: []
|
||||||
|
m_SourcePrefab: {fileID: 100100000, guid: 0b05a2b02a302674d8790b8f19790a9a, type: 3}
|
||||||
--- !u!1 &4356877828275611374
|
--- !u!1 &4356877828275611374
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -15042,7 +15182,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!222 &6983481562846469587
|
--- !u!222 &6983481562846469587
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -32,13 +32,13 @@ public class CustomButton : MonoBehaviour
|
||||||
|
|
||||||
void OnPointerEnter(PointerEventData eventData)
|
void OnPointerEnter(PointerEventData eventData)
|
||||||
{
|
{
|
||||||
transform.DOScale(scaleAmount, scaleDuration).SetEase(easeMode);
|
transform.DOScale(scaleAmount, scaleDuration).SetEase(easeMode).SetUpdate(true);
|
||||||
transform.DOShakePosition(shakeDuration, shakeAmount, shakeVibrato, shakeRandomness, shakeFadeOut, true).SetEase(easeMode);
|
transform.DOShakePosition(shakeDuration, shakeAmount, shakeVibrato, shakeRandomness, shakeFadeOut, true).SetEase(easeMode).SetUpdate(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnPointerExit(PointerEventData eventData)
|
void OnPointerExit(PointerEventData eventData)
|
||||||
{
|
{
|
||||||
transform.DOScale(1f, scaleDuration).SetEase(easeMode);
|
transform.DOScale(1f, scaleDuration).SetEase(easeMode).SetUpdate(true);
|
||||||
transform.DOShakePosition(shakeDuration, shakeAmount, shakeVibrato, shakeRandomness, shakeFadeOut, true).SetEase(easeMode);
|
transform.DOShakePosition(shakeDuration, shakeAmount, shakeVibrato, shakeRandomness, shakeFadeOut, true).SetEase(easeMode).SetUpdate(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,19 @@ using System.Collections.Generic;
|
||||||
using Cinemachine;
|
using Cinemachine;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.InputSystem;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
using static UnityEngine.ParticleSystem;
|
using static UnityEngine.ParticleSystem;
|
||||||
|
|
||||||
public class GameManager : MonoBehaviour
|
public class GameManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public PlayerInputScheme playerInputScheme;
|
||||||
|
private InputAction forwardAction;
|
||||||
|
private InputAction switchAction;
|
||||||
public bool isAuto = false;
|
public bool isAuto = false;
|
||||||
public static GameManager instance;
|
public static GameManager instance;
|
||||||
public void Awake(){
|
|
||||||
instance = this;
|
|
||||||
}
|
|
||||||
public static float movespeed = 0f;
|
public static float movespeed = 0f;
|
||||||
public float acceleration = 5;
|
public float acceleration = 5;
|
||||||
|
|
||||||
|
|
@ -65,7 +68,57 @@ public class GameManager : MonoBehaviour
|
||||||
public Transform leaderboardItemsParent;
|
public Transform leaderboardItemsParent;
|
||||||
public GameObject leaderboardItemPrefab;
|
public GameObject leaderboardItemPrefab;
|
||||||
|
|
||||||
|
[Header("Pause Menu")]
|
||||||
|
public GameObject pauseMenu;
|
||||||
|
public InputAction pauseAction;
|
||||||
|
|
||||||
float startRotationY;
|
float startRotationY;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void Awake(){
|
||||||
|
instance = this;
|
||||||
|
|
||||||
|
playerInputScheme = new PlayerInputScheme();
|
||||||
|
|
||||||
|
forwardAction = playerInputScheme.Car.forward;
|
||||||
|
switchAction = playerInputScheme.Car.horizontal;
|
||||||
|
|
||||||
|
switchAction.performed += OnSwitchPerformed;
|
||||||
|
pauseAction = playerInputScheme.Car.pause;
|
||||||
|
pauseAction.performed += OnPausePerformed;
|
||||||
|
|
||||||
|
Debug.Log("Verifying Inputs:\n" +forwardAction.name + " " + switchAction.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void OnEnable(){
|
||||||
|
forwardAction.Enable();
|
||||||
|
switchAction.Enable();
|
||||||
|
pauseAction.Enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDisable(){
|
||||||
|
forwardAction.Disable();
|
||||||
|
switchAction.Disable();
|
||||||
|
pauseAction.Disable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Resume(){
|
||||||
|
Time.timeScale = 1;
|
||||||
|
pauseMenu.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnPausePerformed(InputAction.CallbackContext context){
|
||||||
|
pauseMenu.SetActive(!pauseMenu.activeSelf);
|
||||||
|
if(pauseMenu.activeSelf){
|
||||||
|
Time.timeScale = 0.001f;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Time.timeScale = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
speedLinesEmission = speedLinesEffect.emission;
|
speedLinesEmission = speedLinesEffect.emission;
|
||||||
|
|
@ -137,20 +190,33 @@ public class GameManager : MonoBehaviour
|
||||||
}
|
}
|
||||||
|
|
||||||
float laneSwitchTime =0;
|
float laneSwitchTime =0;
|
||||||
|
|
||||||
|
|
||||||
|
void OnSwitchPerformed(InputAction.CallbackContext context){
|
||||||
|
Debug.Log("OnSwitchPerformed: " + context.ReadValue<float>());
|
||||||
|
if(context.ReadValue<float>() < 0){
|
||||||
|
currentLaneId++;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
currentLaneId--;
|
||||||
|
}
|
||||||
|
laneSwitchTime = 0;
|
||||||
|
}
|
||||||
void SwitchLanes(){
|
void SwitchLanes(){
|
||||||
|
|
||||||
if(displaySpeed < 10){return;}
|
if(displaySpeed < 10){return;}
|
||||||
|
|
||||||
float switchSpeedMultiplier = 1 + (displaySpeed/laneSwitchSpeed);
|
float switchSpeedMultiplier = 1 + (displaySpeed/laneSwitchSpeed);
|
||||||
|
|
||||||
if(Input.GetKeyDown(KeyCode.LeftArrow)){
|
/// OBSOLETE: Old input method
|
||||||
currentLaneId--;
|
// if(Input.GetKeyDown(KeyCode.LeftArrow)){
|
||||||
laneSwitchTime = 0;
|
// currentLaneId--;
|
||||||
}
|
// laneSwitchTime = 0;
|
||||||
else if(Input.GetKeyDown(KeyCode.RightArrow)){
|
// }
|
||||||
currentLaneId++;
|
// else if(Input.GetKeyDown(KeyCode.RightArrow)){
|
||||||
laneSwitchTime = 0;
|
// currentLaneId++;
|
||||||
}
|
// laneSwitchTime = 0;
|
||||||
|
// }
|
||||||
|
|
||||||
if(laneSwitchTime < 1){
|
if(laneSwitchTime < 1){
|
||||||
laneSwitchTime += Time.deltaTime * 2;
|
laneSwitchTime += Time.deltaTime * 2;
|
||||||
|
|
@ -168,7 +234,7 @@ public class GameManager : MonoBehaviour
|
||||||
|
|
||||||
float displaySpeed = 0;
|
float displaySpeed = 0;
|
||||||
void MoveForward(){
|
void MoveForward(){
|
||||||
float input = Input.GetAxis("Vertical");
|
float input = forwardAction.ReadValue<float>();
|
||||||
|
|
||||||
if(isAuto){input = 0; movespeed = maxspeed /3f;}
|
if(isAuto){input = 0; movespeed = maxspeed /3f;}
|
||||||
movespeed += input * acceleration * Time.deltaTime;
|
movespeed += input * acceleration * Time.deltaTime;
|
||||||
|
|
@ -236,7 +302,9 @@ float displaySpeed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MainMenu(){
|
public void MainMenu(){
|
||||||
|
Resume();
|
||||||
Reset();
|
Reset();
|
||||||
|
|
||||||
SceneManager.LoadScene("MainMenu");
|
SceneManager.LoadScene("MainMenu");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
140
Assets/Scripts/ImageToggle.cs
Normal file
140
Assets/Scripts/ImageToggle.cs
Normal file
|
|
@ -0,0 +1,140 @@
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using DG.Tweening;
|
||||||
|
using UnityEngine.Events;
|
||||||
|
|
||||||
|
[RequireComponent(typeof(EventTrigger))]
|
||||||
|
public class ImageToggle : MonoBehaviour
|
||||||
|
{
|
||||||
|
public UnityEvent<bool> onToggle;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_isOn = false;
|
||||||
|
|
||||||
|
public bool isOn{
|
||||||
|
get{
|
||||||
|
return m_isOn;
|
||||||
|
}
|
||||||
|
set{
|
||||||
|
Toggle(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private Image image;
|
||||||
|
|
||||||
|
public Color onColor = Color.white;
|
||||||
|
public Color offColor = Color.gray;
|
||||||
|
[Header("Swap")]
|
||||||
|
public Sprite onSprite;
|
||||||
|
public Sprite offSprite;
|
||||||
|
|
||||||
|
[Header("Tween Settings")]
|
||||||
|
public float tweenDuration = 0.2f;
|
||||||
|
public Ease tweenEase = Ease.OutQuad;
|
||||||
|
|
||||||
|
public float enabledScale = 1f;
|
||||||
|
public float disabledScale = 0.9f;
|
||||||
|
public float hoverScale = 1.1f;
|
||||||
|
|
||||||
|
private Tweener colorTween;
|
||||||
|
|
||||||
|
private EventTrigger eventTrigger;
|
||||||
|
|
||||||
|
void OnValidate(){
|
||||||
|
if(image == null){
|
||||||
|
image = GetComponent<Image>();
|
||||||
|
}else{
|
||||||
|
UpdateImageColor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Awake(){
|
||||||
|
// Ensure we have an image reference and set initial color instantly
|
||||||
|
if(image == null){
|
||||||
|
image = GetComponent<Image>();
|
||||||
|
}
|
||||||
|
UpdateImageColor();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
eventTrigger = GetComponent<EventTrigger>();
|
||||||
|
EventTrigger.Entry entry = new EventTrigger.Entry();
|
||||||
|
entry.eventID = EventTriggerType.PointerDown;
|
||||||
|
entry.callback.AddListener((data) => {
|
||||||
|
Toggle(!m_isOn);
|
||||||
|
});
|
||||||
|
eventTrigger.triggers.Add(entry);
|
||||||
|
|
||||||
|
entry = new EventTrigger.Entry();
|
||||||
|
entry.eventID = EventTriggerType.PointerEnter;
|
||||||
|
entry.callback.AddListener((data) => {
|
||||||
|
float targetScale = (m_isOn ? enabledScale : disabledScale) * hoverScale;
|
||||||
|
transform.DOScale(targetScale * hoverScale, tweenDuration).SetEase(tweenEase).SetUpdate(true);
|
||||||
|
});
|
||||||
|
eventTrigger.triggers.Add(entry);
|
||||||
|
|
||||||
|
entry = new EventTrigger.Entry();
|
||||||
|
entry.eventID = EventTriggerType.PointerExit;
|
||||||
|
entry.callback.AddListener((data) => {
|
||||||
|
float targetScale = m_isOn ? enabledScale : disabledScale;
|
||||||
|
transform.DOScale(targetScale, tweenDuration).SetEase(tweenEase).SetUpdate(true);
|
||||||
|
});
|
||||||
|
eventTrigger.triggers.Add(entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Toggle(bool value){
|
||||||
|
m_isOn = value;
|
||||||
|
AnimateImageColor();
|
||||||
|
onToggle.Invoke(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateImageColor(){
|
||||||
|
image.color = m_isOn ? onColor : offColor;
|
||||||
|
image.transform.localScale = Vector3.one * (m_isOn ? enabledScale : disabledScale);
|
||||||
|
|
||||||
|
// Update sprite if sprites are assigned
|
||||||
|
if(onSprite != null && offSprite != null){
|
||||||
|
image.sprite = m_isOn ? onSprite : offSprite;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AnimateImageColor(){
|
||||||
|
if(image == null) return;
|
||||||
|
|
||||||
|
// Kill any existing tween on this image's color to avoid conflicts
|
||||||
|
if(colorTween != null && colorTween.IsActive()){
|
||||||
|
colorTween.Kill();
|
||||||
|
}
|
||||||
|
|
||||||
|
Color targetColor = m_isOn ? onColor : offColor;
|
||||||
|
|
||||||
|
// Update sprite if sprites are assigned (sprite changes instantly, no animation)
|
||||||
|
if(onSprite != null && offSprite != null){
|
||||||
|
image.sprite = m_isOn ? onSprite : offSprite;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If duration is 0 or negative, just snap to the color
|
||||||
|
if(tweenDuration <= 0f){
|
||||||
|
image.color = targetColor;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
colorTween = image.DOColor(targetColor, tweenDuration)
|
||||||
|
.SetEase(tweenEase).SetUpdate(true);
|
||||||
|
|
||||||
|
|
||||||
|
AnimateImageScale();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void AnimateImageScale(){
|
||||||
|
if(image == null) return;
|
||||||
|
|
||||||
|
float targetScale = m_isOn ? enabledScale : disabledScale;
|
||||||
|
image.transform.DOScale(targetScale, tweenDuration).SetEase(tweenEase).SetUpdate(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
11
Assets/Scripts/ImageToggle.cs.meta
Normal file
11
Assets/Scripts/ImageToggle.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1296525c722dda443885218850647c2a
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
73
Assets/Scripts/MuteToggle.cs
Normal file
73
Assets/Scripts/MuteToggle.cs
Normal file
|
|
@ -0,0 +1,73 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class MuteToggle : MonoBehaviour
|
||||||
|
{
|
||||||
|
[Header("References")]
|
||||||
|
public ImageToggle toggle;
|
||||||
|
public AudioSource audioSource;
|
||||||
|
|
||||||
|
private const string MUTE_PREF_KEY = "muted";
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
// Always read from PlayerPrefs to ensure consistency across scene changes
|
||||||
|
bool isMuted = GetMutedState();
|
||||||
|
|
||||||
|
// Set the audio source mute state
|
||||||
|
if (audioSource != null)
|
||||||
|
{
|
||||||
|
audioSource.mute = isMuted;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the toggle visual state to match the saved state
|
||||||
|
if (toggle != null)
|
||||||
|
{
|
||||||
|
// Set toggle state without triggering the event (we'll sync it manually)
|
||||||
|
toggle.isOn = !isMuted; // isOn means sound is ON, so !isMuted
|
||||||
|
toggle.onToggle.AddListener(OnToggleChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Log($"MuteToggle initialized - Muted: {isMuted}");
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnToggleChanged(bool isOn)
|
||||||
|
{
|
||||||
|
// isOn means sound is ON, so muted = !isOn
|
||||||
|
bool shouldMute = !isOn;
|
||||||
|
|
||||||
|
// Update audio source
|
||||||
|
if (audioSource != null)
|
||||||
|
{
|
||||||
|
audioSource.mute = shouldMute;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save to PlayerPrefs
|
||||||
|
SetMutedState(shouldMute);
|
||||||
|
|
||||||
|
Debug.Log($"Mute state changed - Muted: {shouldMute}");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GetMutedState()
|
||||||
|
{
|
||||||
|
// Returns true if muted, false if not muted
|
||||||
|
// Default to false (not muted) if key doesn't exist
|
||||||
|
return PlayerPrefs.GetInt(MUTE_PREF_KEY, 0) == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetMutedState(bool muted)
|
||||||
|
{
|
||||||
|
PlayerPrefs.SetInt(MUTE_PREF_KEY, muted ? 1 : 0);
|
||||||
|
PlayerPrefs.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDestroy()
|
||||||
|
{
|
||||||
|
// Clean up listener to prevent memory leaks
|
||||||
|
if (toggle != null)
|
||||||
|
{
|
||||||
|
toggle.onToggle.RemoveListener(OnToggleChanged);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/MuteToggle.cs.meta
Normal file
11
Assets/Scripts/MuteToggle.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 90042cdd91b5373459013e3d24db4f3e
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because one or more lines are too long
BIN
Assets/Textures/UI/no_music_retro.png
Normal file
BIN
Assets/Textures/UI/no_music_retro.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
140
Assets/Textures/UI/no_music_retro.png.meta
Normal file
140
Assets/Textures/UI/no_music_retro.png.meta
Normal file
|
|
@ -0,0 +1,140 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 042a2506a6f954b44a4e2503f69af705
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 12
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 1
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
flipGreenChannel: 0
|
||||||
|
isReadable: 0
|
||||||
|
streamingMipmaps: 0
|
||||||
|
streamingMipmapsPriority: 0
|
||||||
|
vTOnly: 0
|
||||||
|
ignoreMipmapLimit: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 1
|
||||||
|
aniso: 1
|
||||||
|
mipBias: 0
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 0
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 1
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 8
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
flipbookRows: 1
|
||||||
|
flipbookColumns: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
ignorePngGamma: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
swizzle: 50462976
|
||||||
|
cookieLightType: 0
|
||||||
|
platformSettings:
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: WebGL
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 5e97eb03825dee720800000000000000
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
nameFileIdTable: {}
|
||||||
|
mipmapLimitGroupName:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Textures/UI/yes_music_retro.png
Normal file
BIN
Assets/Textures/UI/yes_music_retro.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
140
Assets/Textures/UI/yes_music_retro.png.meta
Normal file
140
Assets/Textures/UI/yes_music_retro.png.meta
Normal file
|
|
@ -0,0 +1,140 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 43c3ae58ae942044ca91d43bd3140341
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 12
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 1
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
flipGreenChannel: 0
|
||||||
|
isReadable: 0
|
||||||
|
streamingMipmaps: 0
|
||||||
|
streamingMipmapsPriority: 0
|
||||||
|
vTOnly: 0
|
||||||
|
ignoreMipmapLimit: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 1
|
||||||
|
aniso: 1
|
||||||
|
mipBias: 0
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 0
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 1
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 8
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
flipbookRows: 1
|
||||||
|
flipbookColumns: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
ignorePngGamma: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
swizzle: 50462976
|
||||||
|
cookieLightType: 0
|
||||||
|
platformSettings:
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: WebGL
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 5e97eb03825dee720800000000000000
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
nameFileIdTable: {}
|
||||||
|
mipmapLimitGroupName:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/music/TITENSE - Synthwave.mp3
Normal file
BIN
Assets/music/TITENSE - Synthwave.mp3
Normal file
Binary file not shown.
23
Assets/music/TITENSE - Synthwave.mp3.meta
Normal file
23
Assets/music/TITENSE - Synthwave.mp3.meta
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6c19bf6ca1608914183ed9855886cc05
|
||||||
|
AudioImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 7
|
||||||
|
defaultSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
loadType: 0
|
||||||
|
sampleRateSetting: 0
|
||||||
|
sampleRateOverride: 44100
|
||||||
|
compressionFormat: 1
|
||||||
|
quality: 1
|
||||||
|
conversionMode: 0
|
||||||
|
preloadAudioData: 0
|
||||||
|
platformSettingOverrides: {}
|
||||||
|
forceToMono: 0
|
||||||
|
normalize: 1
|
||||||
|
loadInBackground: 0
|
||||||
|
ambisonic: 0
|
||||||
|
3D: 1
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
"com.unity.ide.rider": "3.0.37",
|
"com.unity.ide.rider": "3.0.37",
|
||||||
"com.unity.ide.visualstudio": "2.0.18",
|
"com.unity.ide.visualstudio": "2.0.18",
|
||||||
"com.unity.ide.vscode": "1.2.5",
|
"com.unity.ide.vscode": "1.2.5",
|
||||||
|
"com.unity.inputsystem": "1.7.0",
|
||||||
"com.unity.postprocessing": "3.2.2",
|
"com.unity.postprocessing": "3.2.2",
|
||||||
"com.unity.render-pipelines.universal": "14.0.8",
|
"com.unity.render-pipelines.universal": "14.0.8",
|
||||||
"com.unity.test-framework": "1.1.33",
|
"com.unity.test-framework": "1.1.33",
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,15 @@
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
|
"com.unity.inputsystem": {
|
||||||
|
"version": "1.7.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.uielements": "1.0.0"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
"com.unity.mathematics": {
|
"com.unity.mathematics": {
|
||||||
"version": "1.2.6",
|
"version": "1.2.6",
|
||||||
"depth": 1,
|
"depth": 1,
|
||||||
|
|
|
||||||
|
|
@ -928,7 +928,7 @@ PlayerSettings:
|
||||||
hmiLogStartupTiming: 0
|
hmiLogStartupTiming: 0
|
||||||
hmiCpuConfiguration:
|
hmiCpuConfiguration:
|
||||||
apiCompatibilityLevel: 6
|
apiCompatibilityLevel: 6
|
||||||
activeInputHandler: 0
|
activeInputHandler: 2
|
||||||
windowsGamepadBackendHint: 0
|
windowsGamepadBackendHint: 0
|
||||||
cloudProjectId: 5db7501a-f0f5-495d-a008-26817e558ef0
|
cloudProjectId: 5db7501a-f0f5-495d-a008-26817e558ef0
|
||||||
framebufferDepthMemorylessMode: 0
|
framebufferDepthMemorylessMode: 0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user