diff --git a/AGENTS.md b/AGENTS.md index 0d797c3..f5df7b8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,14 +1,8 @@ - Project name: HelixJump - Unity version: Unity 6000.3.0f1 -- Active scene: - - Name: SampleScene - - Tags: - - Untagged, Respawn, Finish, EditorOnly, MainCamera, Player, GameController, Platform - - Layers: - - Default, TransparentFX, Ignore Raycast, Water, UI - Active game object: - - Name: CinemachineCamera - - Tag: Untagged + - Name: Soccer Ball + - Tag: Player - Layer: Default \ No newline at end of file diff --git a/Assets/GameInputs.cs b/Assets/GameInputs.cs deleted file mode 100644 index 5538070..0000000 --- a/Assets/GameInputs.cs +++ /dev/null @@ -1,1240 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator -// version 1.16.0 -// from Assets/GameInputs.inputactions -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine.InputSystem; -using UnityEngine.InputSystem.Utilities; - -/// -/// Provides programmatic access to , , and instances defined in asset "Assets/GameInputs.inputactions". -/// -/// -/// This class is source generated and any manual edits will be discarded if the associated asset is reimported or modified. -/// -/// -/// -/// using namespace UnityEngine; -/// using UnityEngine.InputSystem; -/// -/// // Example of using an InputActionMap named "Player" from a UnityEngine.MonoBehaviour implementing callback interface. -/// public class Example : MonoBehaviour, MyActions.IPlayerActions -/// { -/// private MyActions_Actions m_Actions; // Source code representation of asset. -/// private MyActions_Actions.PlayerActions m_Player; // Source code representation of action map. -/// -/// void Awake() -/// { -/// m_Actions = new MyActions_Actions(); // Create asset object. -/// m_Player = m_Actions.Player; // Extract action map object. -/// m_Player.AddCallbacks(this); // Register callback interface IPlayerActions. -/// } -/// -/// void OnDestroy() -/// { -/// m_Actions.Dispose(); // Destroy asset object. -/// } -/// -/// void OnEnable() -/// { -/// m_Player.Enable(); // Enable all actions within map. -/// } -/// -/// void OnDisable() -/// { -/// m_Player.Disable(); // Disable all actions within map. -/// } -/// -/// #region Interface implementation of MyActions.IPlayerActions -/// -/// // Invoked when "Move" action is either started, performed or canceled. -/// public void OnMove(InputAction.CallbackContext context) -/// { -/// Debug.Log($"OnMove: {context.ReadValue<Vector2>()}"); -/// } -/// -/// // Invoked when "Attack" action is either started, performed or canceled. -/// public void OnAttack(InputAction.CallbackContext context) -/// { -/// Debug.Log($"OnAttack: {context.ReadValue<float>()}"); -/// } -/// -/// #endregion -/// } -/// -/// -public partial class @GameInputs: IInputActionCollection2, IDisposable -{ - /// - /// Provides access to the underlying asset instance. - /// - public InputActionAsset asset { get; } - - /// - /// Constructs a new instance. - /// - public @GameInputs() - { - asset = InputActionAsset.FromJson(@"{ - ""version"": 1, - ""name"": ""GameInputs"", - ""maps"": [ - { - ""name"": ""Player"", - ""id"": ""df70fa95-8a34-4494-b137-73ab6b9c7d37"", - ""actions"": [ - { - ""name"": ""Drag"", - ""type"": ""Value"", - ""id"": ""54e956de-82e3-4015-81a8-136684fb454d"", - ""expectedControlType"": """", - ""processors"": """", - ""interactions"": """", - ""initialStateCheck"": true - } - ], - ""bindings"": [ - { - ""name"": """", - ""id"": ""cd60ba9b-f92e-4ec7-bfb6-c97e1cccedab"", - ""path"": ""/touch0/delta"", - ""interactions"": """", - ""processors"": """", - ""groups"": "";XR"", - ""action"": ""Drag"", - ""isComposite"": false, - ""isPartOfComposite"": false - } - ] - }, - { - ""name"": ""UI"", - ""id"": ""272f6d14-89ba-496f-b7ff-215263d3219f"", - ""actions"": [ - { - ""name"": ""Navigate"", - ""type"": ""PassThrough"", - ""id"": ""c95b2375-e6d9-4b88-9c4c-c5e76515df4b"", - ""expectedControlType"": ""Vector2"", - ""processors"": """", - ""interactions"": """", - ""initialStateCheck"": false - }, - { - ""name"": ""Submit"", - ""type"": ""Button"", - ""id"": ""7607c7b6-cd76-4816-beef-bd0341cfe950"", - ""expectedControlType"": ""Button"", - ""processors"": """", - ""interactions"": """", - ""initialStateCheck"": false - }, - { - ""name"": ""Cancel"", - ""type"": ""Button"", - ""id"": ""15cef263-9014-4fd5-94d9-4e4a6234a6ef"", - ""expectedControlType"": ""Button"", - ""processors"": """", - ""interactions"": """", - ""initialStateCheck"": false - }, - { - ""name"": ""Point"", - ""type"": ""PassThrough"", - ""id"": ""32b35790-4ed0-4e9a-aa41-69ac6d629449"", - ""expectedControlType"": ""Vector2"", - ""processors"": """", - ""interactions"": """", - ""initialStateCheck"": true - }, - { - ""name"": ""Click"", - ""type"": ""PassThrough"", - ""id"": ""3c7022bf-7922-4f7c-a998-c437916075ad"", - ""expectedControlType"": ""Button"", - ""processors"": """", - ""interactions"": """", - ""initialStateCheck"": true - }, - { - ""name"": ""RightClick"", - ""type"": ""PassThrough"", - ""id"": ""44b200b1-1557-4083-816c-b22cbdf77ddf"", - ""expectedControlType"": ""Button"", - ""processors"": """", - ""interactions"": """", - ""initialStateCheck"": false - }, - { - ""name"": ""MiddleClick"", - ""type"": ""PassThrough"", - ""id"": ""dad70c86-b58c-4b17-88ad-f5e53adf419e"", - ""expectedControlType"": ""Button"", - ""processors"": """", - ""interactions"": """", - ""initialStateCheck"": false - }, - { - ""name"": ""ScrollWheel"", - ""type"": ""PassThrough"", - ""id"": ""0489e84a-4833-4c40-bfae-cea84b696689"", - ""expectedControlType"": ""Vector2"", - ""processors"": """", - ""interactions"": """", - ""initialStateCheck"": false - }, - { - ""name"": ""TrackedDevicePosition"", - ""type"": ""PassThrough"", - ""id"": ""24908448-c609-4bc3-a128-ea258674378a"", - ""expectedControlType"": ""Vector3"", - ""processors"": """", - ""interactions"": """", - ""initialStateCheck"": false - }, - { - ""name"": ""TrackedDeviceOrientation"", - ""type"": ""PassThrough"", - ""id"": ""9caa3d8a-6b2f-4e8e-8bad-6ede561bd9be"", - ""expectedControlType"": ""Quaternion"", - ""processors"": """", - ""interactions"": """", - ""initialStateCheck"": false - } - ], - ""bindings"": [ - { - ""name"": ""Gamepad"", - ""id"": ""809f371f-c5e2-4e7a-83a1-d867598f40dd"", - ""path"": ""2DVector"", - ""interactions"": """", - ""processors"": """", - ""groups"": """", - ""action"": ""Navigate"", - ""isComposite"": true, - ""isPartOfComposite"": false - }, - { - ""name"": ""up"", - ""id"": ""14a5d6e8-4aaf-4119-a9ef-34b8c2c548bf"", - ""path"": ""/leftStick/up"", - ""interactions"": """", - ""processors"": """", - ""groups"": "";Gamepad"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""up"", - ""id"": ""9144cbe6-05e1-4687-a6d7-24f99d23dd81"", - ""path"": ""/rightStick/up"", - ""interactions"": """", - ""processors"": """", - ""groups"": "";Gamepad"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""down"", - ""id"": ""2db08d65-c5fb-421b-983f-c71163608d67"", - ""path"": ""/leftStick/down"", - ""interactions"": """", - ""processors"": """", - ""groups"": "";Gamepad"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""down"", - ""id"": ""58748904-2ea9-4a80-8579-b500e6a76df8"", - ""path"": ""/rightStick/down"", - ""interactions"": """", - ""processors"": """", - ""groups"": "";Gamepad"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""left"", - ""id"": ""8ba04515-75aa-45de-966d-393d9bbd1c14"", - ""path"": ""/leftStick/left"", - ""interactions"": """", - ""processors"": """", - ""groups"": "";Gamepad"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""left"", - ""id"": ""712e721c-bdfb-4b23-a86c-a0d9fcfea921"", - ""path"": ""/rightStick/left"", - ""interactions"": """", - ""processors"": """", - ""groups"": "";Gamepad"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""right"", - ""id"": ""fcd248ae-a788-4676-a12e-f4d81205600b"", - ""path"": ""/leftStick/right"", - ""interactions"": """", - ""processors"": """", - ""groups"": "";Gamepad"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""right"", - ""id"": ""1f04d9bc-c50b-41a1-bfcc-afb75475ec20"", - ""path"": ""/rightStick/right"", - ""interactions"": """", - ""processors"": """", - ""groups"": "";Gamepad"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": """", - ""id"": ""fb8277d4-c5cd-4663-9dc7-ee3f0b506d90"", - ""path"": ""/dpad"", - ""interactions"": """", - ""processors"": """", - ""groups"": "";Gamepad"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": false - }, - { - ""name"": ""Joystick"", - ""id"": ""e25d9774-381c-4a61-b47c-7b6b299ad9f9"", - ""path"": ""2DVector"", - ""interactions"": """", - ""processors"": """", - ""groups"": """", - ""action"": ""Navigate"", - ""isComposite"": true, - ""isPartOfComposite"": false - }, - { - ""name"": ""up"", - ""id"": ""3db53b26-6601-41be-9887-63ac74e79d19"", - ""path"": ""/stick/up"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Joystick"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""down"", - ""id"": ""0cb3e13e-3d90-4178-8ae6-d9c5501d653f"", - ""path"": ""/stick/down"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Joystick"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""left"", - ""id"": ""0392d399-f6dd-4c82-8062-c1e9c0d34835"", - ""path"": ""/stick/left"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Joystick"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""right"", - ""id"": ""942a66d9-d42f-43d6-8d70-ecb4ba5363bc"", - ""path"": ""/stick/right"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Joystick"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""Keyboard"", - ""id"": ""ff527021-f211-4c02-933e-5976594c46ed"", - ""path"": ""2DVector"", - ""interactions"": """", - ""processors"": """", - ""groups"": """", - ""action"": ""Navigate"", - ""isComposite"": true, - ""isPartOfComposite"": false - }, - { - ""name"": ""up"", - ""id"": ""563fbfdd-0f09-408d-aa75-8642c4f08ef0"", - ""path"": ""/w"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Keyboard&Mouse"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""up"", - ""id"": ""eb480147-c587-4a33-85ed-eb0ab9942c43"", - ""path"": ""/upArrow"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Keyboard&Mouse"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""down"", - ""id"": ""2bf42165-60bc-42ca-8072-8c13ab40239b"", - ""path"": ""/s"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Keyboard&Mouse"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""down"", - ""id"": ""85d264ad-e0a0-4565-b7ff-1a37edde51ac"", - ""path"": ""/downArrow"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Keyboard&Mouse"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""left"", - ""id"": ""74214943-c580-44e4-98eb-ad7eebe17902"", - ""path"": ""/a"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Keyboard&Mouse"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""left"", - ""id"": ""cea9b045-a000-445b-95b8-0c171af70a3b"", - ""path"": ""/leftArrow"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Keyboard&Mouse"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""right"", - ""id"": ""8607c725-d935-4808-84b1-8354e29bab63"", - ""path"": ""/d"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Keyboard&Mouse"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": ""right"", - ""id"": ""4cda81dc-9edd-4e03-9d7c-a71a14345d0b"", - ""path"": ""/rightArrow"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Keyboard&Mouse"", - ""action"": ""Navigate"", - ""isComposite"": false, - ""isPartOfComposite"": true - }, - { - ""name"": """", - ""id"": ""9e92bb26-7e3b-4ec4-b06b-3c8f8e498ddc"", - ""path"": ""*/{Submit}"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Keyboard&Mouse;Gamepad;Touch;Joystick;XR"", - ""action"": ""Submit"", - ""isComposite"": false, - ""isPartOfComposite"": false - }, - { - ""name"": """", - ""id"": ""82627dcc-3b13-4ba9-841d-e4b746d6553e"", - ""path"": ""*/{Cancel}"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Keyboard&Mouse;Gamepad;Touch;Joystick;XR"", - ""action"": ""Cancel"", - ""isComposite"": false, - ""isPartOfComposite"": false - }, - { - ""name"": """", - ""id"": ""c52c8e0b-8179-41d3-b8a1-d149033bbe86"", - ""path"": ""/position"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Keyboard&Mouse"", - ""action"": ""Point"", - ""isComposite"": false, - ""isPartOfComposite"": false - }, - { - ""name"": """", - ""id"": ""e1394cbc-336e-44ce-9ea8-6007ed6193f7"", - ""path"": ""/position"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Keyboard&Mouse"", - ""action"": ""Point"", - ""isComposite"": false, - ""isPartOfComposite"": false - }, - { - ""name"": """", - ""id"": ""5693e57a-238a-46ed-b5ae-e64e6e574302"", - ""path"": ""/touch*/position"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Touch"", - ""action"": ""Point"", - ""isComposite"": false, - ""isPartOfComposite"": false - }, - { - ""name"": """", - ""id"": ""4faf7dc9-b979-4210-aa8c-e808e1ef89f5"", - ""path"": ""/leftButton"", - ""interactions"": """", - ""processors"": """", - ""groups"": "";Keyboard&Mouse"", - ""action"": ""Click"", - ""isComposite"": false, - ""isPartOfComposite"": false - }, - { - ""name"": """", - ""id"": ""8d66d5ba-88d7-48e6-b1cd-198bbfef7ace"", - ""path"": ""/tip"", - ""interactions"": """", - ""processors"": """", - ""groups"": "";Keyboard&Mouse"", - ""action"": ""Click"", - ""isComposite"": false, - ""isPartOfComposite"": false - }, - { - ""name"": """", - ""id"": ""47c2a644-3ebc-4dae-a106-589b7ca75b59"", - ""path"": ""/touch*/press"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Touch"", - ""action"": ""Click"", - ""isComposite"": false, - ""isPartOfComposite"": false - }, - { - ""name"": """", - ""id"": ""bb9e6b34-44bf-4381-ac63-5aa15d19f677"", - ""path"": ""/trigger"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""XR"", - ""action"": ""Click"", - ""isComposite"": false, - ""isPartOfComposite"": false - }, - { - ""name"": """", - ""id"": ""38c99815-14ea-4617-8627-164d27641299"", - ""path"": ""/scroll"", - ""interactions"": """", - ""processors"": """", - ""groups"": "";Keyboard&Mouse"", - ""action"": ""ScrollWheel"", - ""isComposite"": false, - ""isPartOfComposite"": false - }, - { - ""name"": """", - ""id"": ""4c191405-5738-4d4b-a523-c6a301dbf754"", - ""path"": ""/rightButton"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Keyboard&Mouse"", - ""action"": ""RightClick"", - ""isComposite"": false, - ""isPartOfComposite"": false - }, - { - ""name"": """", - ""id"": ""24066f69-da47-44f3-a07e-0015fb02eb2e"", - ""path"": ""/middleButton"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""Keyboard&Mouse"", - ""action"": ""MiddleClick"", - ""isComposite"": false, - ""isPartOfComposite"": false - }, - { - ""name"": """", - ""id"": ""7236c0d9-6ca3-47cf-a6ee-a97f5b59ea77"", - ""path"": ""/devicePosition"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""XR"", - ""action"": ""TrackedDevicePosition"", - ""isComposite"": false, - ""isPartOfComposite"": false - }, - { - ""name"": """", - ""id"": ""23e01e3a-f935-4948-8d8b-9bcac77714fb"", - ""path"": ""/deviceRotation"", - ""interactions"": """", - ""processors"": """", - ""groups"": ""XR"", - ""action"": ""TrackedDeviceOrientation"", - ""isComposite"": false, - ""isPartOfComposite"": false - } - ] - } - ], - ""controlSchemes"": [ - { - ""name"": ""Keyboard&Mouse"", - ""bindingGroup"": ""Keyboard&Mouse"", - ""devices"": [ - { - ""devicePath"": """", - ""isOptional"": false, - ""isOR"": false - }, - { - ""devicePath"": """", - ""isOptional"": false, - ""isOR"": false - } - ] - }, - { - ""name"": ""Gamepad"", - ""bindingGroup"": ""Gamepad"", - ""devices"": [ - { - ""devicePath"": """", - ""isOptional"": false, - ""isOR"": false - } - ] - }, - { - ""name"": ""Touch"", - ""bindingGroup"": ""Touch"", - ""devices"": [ - { - ""devicePath"": """", - ""isOptional"": false, - ""isOR"": false - } - ] - }, - { - ""name"": ""Joystick"", - ""bindingGroup"": ""Joystick"", - ""devices"": [ - { - ""devicePath"": """", - ""isOptional"": false, - ""isOR"": false - } - ] - }, - { - ""name"": ""XR"", - ""bindingGroup"": ""XR"", - ""devices"": [ - { - ""devicePath"": """", - ""isOptional"": false, - ""isOR"": false - } - ] - } - ] -}"); - // Player - m_Player = asset.FindActionMap("Player", throwIfNotFound: true); - m_Player_Drag = m_Player.FindAction("Drag", throwIfNotFound: true); - // UI - m_UI = asset.FindActionMap("UI", throwIfNotFound: true); - m_UI_Navigate = m_UI.FindAction("Navigate", throwIfNotFound: true); - m_UI_Submit = m_UI.FindAction("Submit", throwIfNotFound: true); - m_UI_Cancel = m_UI.FindAction("Cancel", throwIfNotFound: true); - m_UI_Point = m_UI.FindAction("Point", throwIfNotFound: true); - m_UI_Click = m_UI.FindAction("Click", throwIfNotFound: true); - m_UI_RightClick = m_UI.FindAction("RightClick", throwIfNotFound: true); - m_UI_MiddleClick = m_UI.FindAction("MiddleClick", throwIfNotFound: true); - m_UI_ScrollWheel = m_UI.FindAction("ScrollWheel", throwIfNotFound: true); - m_UI_TrackedDevicePosition = m_UI.FindAction("TrackedDevicePosition", throwIfNotFound: true); - m_UI_TrackedDeviceOrientation = m_UI.FindAction("TrackedDeviceOrientation", throwIfNotFound: true); - } - - ~@GameInputs() - { - UnityEngine.Debug.Assert(!m_Player.enabled, "This will cause a leak and performance issues, GameInputs.Player.Disable() has not been called."); - UnityEngine.Debug.Assert(!m_UI.enabled, "This will cause a leak and performance issues, GameInputs.UI.Disable() has not been called."); - } - - /// - /// Destroys this asset and all associated instances. - /// - public void Dispose() - { - UnityEngine.Object.Destroy(asset); - } - - /// - public InputBinding? bindingMask - { - get => asset.bindingMask; - set => asset.bindingMask = value; - } - - /// - public ReadOnlyArray? devices - { - get => asset.devices; - set => asset.devices = value; - } - - /// - public ReadOnlyArray controlSchemes => asset.controlSchemes; - - /// - public bool Contains(InputAction action) - { - return asset.Contains(action); - } - - /// - public IEnumerator GetEnumerator() - { - return asset.GetEnumerator(); - } - - /// - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - /// - public void Enable() - { - asset.Enable(); - } - - /// - public void Disable() - { - asset.Disable(); - } - - /// - public IEnumerable 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); - } - - // Player - private readonly InputActionMap m_Player; - private List m_PlayerActionsCallbackInterfaces = new List(); - private readonly InputAction m_Player_Drag; - /// - /// Provides access to input actions defined in input action map "Player". - /// - public struct PlayerActions - { - private @GameInputs m_Wrapper; - - /// - /// Construct a new instance of the input action map wrapper class. - /// - public PlayerActions(@GameInputs wrapper) { m_Wrapper = wrapper; } - /// - /// Provides access to the underlying input action "Player/Drag". - /// - public InputAction @Drag => m_Wrapper.m_Player_Drag; - /// - /// Provides access to the underlying input action map instance. - /// - public InputActionMap Get() { return m_Wrapper.m_Player; } - /// - public void Enable() { Get().Enable(); } - /// - public void Disable() { Get().Disable(); } - /// - public bool enabled => Get().enabled; - /// - /// Implicitly converts an to an instance. - /// - public static implicit operator InputActionMap(PlayerActions set) { return set.Get(); } - /// - /// Adds , and callbacks provided via on all input actions contained in this map. - /// - /// Callback instance. - /// - /// If is null or have already been added this method does nothing. - /// - /// - public void AddCallbacks(IPlayerActions instance) - { - if (instance == null || m_Wrapper.m_PlayerActionsCallbackInterfaces.Contains(instance)) return; - m_Wrapper.m_PlayerActionsCallbackInterfaces.Add(instance); - @Drag.started += instance.OnDrag; - @Drag.performed += instance.OnDrag; - @Drag.canceled += instance.OnDrag; - } - - /// - /// Removes , and callbacks provided via on all input actions contained in this map. - /// - /// - /// Calling this method when have not previously been registered has no side-effects. - /// - /// - private void UnregisterCallbacks(IPlayerActions instance) - { - @Drag.started -= instance.OnDrag; - @Drag.performed -= instance.OnDrag; - @Drag.canceled -= instance.OnDrag; - } - - /// - /// Unregisters and unregisters all input action callbacks via . - /// - /// - public void RemoveCallbacks(IPlayerActions instance) - { - if (m_Wrapper.m_PlayerActionsCallbackInterfaces.Remove(instance)) - UnregisterCallbacks(instance); - } - - /// - /// Replaces all existing callback instances and previously registered input action callbacks associated with them with callbacks provided via . - /// - /// - /// If is null, calling this method will only unregister all existing callbacks but not register any new callbacks. - /// - /// - /// - /// - public void SetCallbacks(IPlayerActions instance) - { - foreach (var item in m_Wrapper.m_PlayerActionsCallbackInterfaces) - UnregisterCallbacks(item); - m_Wrapper.m_PlayerActionsCallbackInterfaces.Clear(); - AddCallbacks(instance); - } - } - /// - /// Provides a new instance referencing this action map. - /// - public PlayerActions @Player => new PlayerActions(this); - - // UI - private readonly InputActionMap m_UI; - private List m_UIActionsCallbackInterfaces = new List(); - private readonly InputAction m_UI_Navigate; - private readonly InputAction m_UI_Submit; - private readonly InputAction m_UI_Cancel; - private readonly InputAction m_UI_Point; - private readonly InputAction m_UI_Click; - private readonly InputAction m_UI_RightClick; - private readonly InputAction m_UI_MiddleClick; - private readonly InputAction m_UI_ScrollWheel; - private readonly InputAction m_UI_TrackedDevicePosition; - private readonly InputAction m_UI_TrackedDeviceOrientation; - /// - /// Provides access to input actions defined in input action map "UI". - /// - public struct UIActions - { - private @GameInputs m_Wrapper; - - /// - /// Construct a new instance of the input action map wrapper class. - /// - public UIActions(@GameInputs wrapper) { m_Wrapper = wrapper; } - /// - /// Provides access to the underlying input action "UI/Navigate". - /// - public InputAction @Navigate => m_Wrapper.m_UI_Navigate; - /// - /// Provides access to the underlying input action "UI/Submit". - /// - public InputAction @Submit => m_Wrapper.m_UI_Submit; - /// - /// Provides access to the underlying input action "UI/Cancel". - /// - public InputAction @Cancel => m_Wrapper.m_UI_Cancel; - /// - /// Provides access to the underlying input action "UI/Point". - /// - public InputAction @Point => m_Wrapper.m_UI_Point; - /// - /// Provides access to the underlying input action "UI/Click". - /// - public InputAction @Click => m_Wrapper.m_UI_Click; - /// - /// Provides access to the underlying input action "UI/RightClick". - /// - public InputAction @RightClick => m_Wrapper.m_UI_RightClick; - /// - /// Provides access to the underlying input action "UI/MiddleClick". - /// - public InputAction @MiddleClick => m_Wrapper.m_UI_MiddleClick; - /// - /// Provides access to the underlying input action "UI/ScrollWheel". - /// - public InputAction @ScrollWheel => m_Wrapper.m_UI_ScrollWheel; - /// - /// Provides access to the underlying input action "UI/TrackedDevicePosition". - /// - public InputAction @TrackedDevicePosition => m_Wrapper.m_UI_TrackedDevicePosition; - /// - /// Provides access to the underlying input action "UI/TrackedDeviceOrientation". - /// - public InputAction @TrackedDeviceOrientation => m_Wrapper.m_UI_TrackedDeviceOrientation; - /// - /// Provides access to the underlying input action map instance. - /// - public InputActionMap Get() { return m_Wrapper.m_UI; } - /// - public void Enable() { Get().Enable(); } - /// - public void Disable() { Get().Disable(); } - /// - public bool enabled => Get().enabled; - /// - /// Implicitly converts an to an instance. - /// - public static implicit operator InputActionMap(UIActions set) { return set.Get(); } - /// - /// Adds , and callbacks provided via on all input actions contained in this map. - /// - /// Callback instance. - /// - /// If is null or have already been added this method does nothing. - /// - /// - public void AddCallbacks(IUIActions instance) - { - if (instance == null || m_Wrapper.m_UIActionsCallbackInterfaces.Contains(instance)) return; - m_Wrapper.m_UIActionsCallbackInterfaces.Add(instance); - @Navigate.started += instance.OnNavigate; - @Navigate.performed += instance.OnNavigate; - @Navigate.canceled += instance.OnNavigate; - @Submit.started += instance.OnSubmit; - @Submit.performed += instance.OnSubmit; - @Submit.canceled += instance.OnSubmit; - @Cancel.started += instance.OnCancel; - @Cancel.performed += instance.OnCancel; - @Cancel.canceled += instance.OnCancel; - @Point.started += instance.OnPoint; - @Point.performed += instance.OnPoint; - @Point.canceled += instance.OnPoint; - @Click.started += instance.OnClick; - @Click.performed += instance.OnClick; - @Click.canceled += instance.OnClick; - @RightClick.started += instance.OnRightClick; - @RightClick.performed += instance.OnRightClick; - @RightClick.canceled += instance.OnRightClick; - @MiddleClick.started += instance.OnMiddleClick; - @MiddleClick.performed += instance.OnMiddleClick; - @MiddleClick.canceled += instance.OnMiddleClick; - @ScrollWheel.started += instance.OnScrollWheel; - @ScrollWheel.performed += instance.OnScrollWheel; - @ScrollWheel.canceled += instance.OnScrollWheel; - @TrackedDevicePosition.started += instance.OnTrackedDevicePosition; - @TrackedDevicePosition.performed += instance.OnTrackedDevicePosition; - @TrackedDevicePosition.canceled += instance.OnTrackedDevicePosition; - @TrackedDeviceOrientation.started += instance.OnTrackedDeviceOrientation; - @TrackedDeviceOrientation.performed += instance.OnTrackedDeviceOrientation; - @TrackedDeviceOrientation.canceled += instance.OnTrackedDeviceOrientation; - } - - /// - /// Removes , and callbacks provided via on all input actions contained in this map. - /// - /// - /// Calling this method when have not previously been registered has no side-effects. - /// - /// - private void UnregisterCallbacks(IUIActions instance) - { - @Navigate.started -= instance.OnNavigate; - @Navigate.performed -= instance.OnNavigate; - @Navigate.canceled -= instance.OnNavigate; - @Submit.started -= instance.OnSubmit; - @Submit.performed -= instance.OnSubmit; - @Submit.canceled -= instance.OnSubmit; - @Cancel.started -= instance.OnCancel; - @Cancel.performed -= instance.OnCancel; - @Cancel.canceled -= instance.OnCancel; - @Point.started -= instance.OnPoint; - @Point.performed -= instance.OnPoint; - @Point.canceled -= instance.OnPoint; - @Click.started -= instance.OnClick; - @Click.performed -= instance.OnClick; - @Click.canceled -= instance.OnClick; - @RightClick.started -= instance.OnRightClick; - @RightClick.performed -= instance.OnRightClick; - @RightClick.canceled -= instance.OnRightClick; - @MiddleClick.started -= instance.OnMiddleClick; - @MiddleClick.performed -= instance.OnMiddleClick; - @MiddleClick.canceled -= instance.OnMiddleClick; - @ScrollWheel.started -= instance.OnScrollWheel; - @ScrollWheel.performed -= instance.OnScrollWheel; - @ScrollWheel.canceled -= instance.OnScrollWheel; - @TrackedDevicePosition.started -= instance.OnTrackedDevicePosition; - @TrackedDevicePosition.performed -= instance.OnTrackedDevicePosition; - @TrackedDevicePosition.canceled -= instance.OnTrackedDevicePosition; - @TrackedDeviceOrientation.started -= instance.OnTrackedDeviceOrientation; - @TrackedDeviceOrientation.performed -= instance.OnTrackedDeviceOrientation; - @TrackedDeviceOrientation.canceled -= instance.OnTrackedDeviceOrientation; - } - - /// - /// Unregisters and unregisters all input action callbacks via . - /// - /// - public void RemoveCallbacks(IUIActions instance) - { - if (m_Wrapper.m_UIActionsCallbackInterfaces.Remove(instance)) - UnregisterCallbacks(instance); - } - - /// - /// Replaces all existing callback instances and previously registered input action callbacks associated with them with callbacks provided via . - /// - /// - /// If is null, calling this method will only unregister all existing callbacks but not register any new callbacks. - /// - /// - /// - /// - public void SetCallbacks(IUIActions instance) - { - foreach (var item in m_Wrapper.m_UIActionsCallbackInterfaces) - UnregisterCallbacks(item); - m_Wrapper.m_UIActionsCallbackInterfaces.Clear(); - AddCallbacks(instance); - } - } - /// - /// Provides a new instance referencing this action map. - /// - public UIActions @UI => new UIActions(this); - private int m_KeyboardMouseSchemeIndex = -1; - /// - /// Provides access to the input control scheme. - /// - /// - public InputControlScheme KeyboardMouseScheme - { - get - { - if (m_KeyboardMouseSchemeIndex == -1) m_KeyboardMouseSchemeIndex = asset.FindControlSchemeIndex("Keyboard&Mouse"); - return asset.controlSchemes[m_KeyboardMouseSchemeIndex]; - } - } - private int m_GamepadSchemeIndex = -1; - /// - /// Provides access to the input control scheme. - /// - /// - public InputControlScheme GamepadScheme - { - get - { - if (m_GamepadSchemeIndex == -1) m_GamepadSchemeIndex = asset.FindControlSchemeIndex("Gamepad"); - return asset.controlSchemes[m_GamepadSchemeIndex]; - } - } - private int m_TouchSchemeIndex = -1; - /// - /// Provides access to the input control scheme. - /// - /// - public InputControlScheme TouchScheme - { - get - { - if (m_TouchSchemeIndex == -1) m_TouchSchemeIndex = asset.FindControlSchemeIndex("Touch"); - return asset.controlSchemes[m_TouchSchemeIndex]; - } - } - private int m_JoystickSchemeIndex = -1; - /// - /// Provides access to the input control scheme. - /// - /// - public InputControlScheme JoystickScheme - { - get - { - if (m_JoystickSchemeIndex == -1) m_JoystickSchemeIndex = asset.FindControlSchemeIndex("Joystick"); - return asset.controlSchemes[m_JoystickSchemeIndex]; - } - } - private int m_XRSchemeIndex = -1; - /// - /// Provides access to the input control scheme. - /// - /// - public InputControlScheme XRScheme - { - get - { - if (m_XRSchemeIndex == -1) m_XRSchemeIndex = asset.FindControlSchemeIndex("XR"); - return asset.controlSchemes[m_XRSchemeIndex]; - } - } - /// - /// Interface to implement callback methods for all input action callbacks associated with input actions defined by "Player" which allows adding and removing callbacks. - /// - /// - /// - public interface IPlayerActions - { - /// - /// Method invoked when associated input action "Drag" is either , or . - /// - /// - /// - /// - void OnDrag(InputAction.CallbackContext context); - } - /// - /// Interface to implement callback methods for all input action callbacks associated with input actions defined by "UI" which allows adding and removing callbacks. - /// - /// - /// - public interface IUIActions - { - /// - /// Method invoked when associated input action "Navigate" is either , or . - /// - /// - /// - /// - void OnNavigate(InputAction.CallbackContext context); - /// - /// Method invoked when associated input action "Submit" is either , or . - /// - /// - /// - /// - void OnSubmit(InputAction.CallbackContext context); - /// - /// Method invoked when associated input action "Cancel" is either , or . - /// - /// - /// - /// - void OnCancel(InputAction.CallbackContext context); - /// - /// Method invoked when associated input action "Point" is either , or . - /// - /// - /// - /// - void OnPoint(InputAction.CallbackContext context); - /// - /// Method invoked when associated input action "Click" is either , or . - /// - /// - /// - /// - void OnClick(InputAction.CallbackContext context); - /// - /// Method invoked when associated input action "RightClick" is either , or . - /// - /// - /// - /// - void OnRightClick(InputAction.CallbackContext context); - /// - /// Method invoked when associated input action "MiddleClick" is either , or . - /// - /// - /// - /// - void OnMiddleClick(InputAction.CallbackContext context); - /// - /// Method invoked when associated input action "ScrollWheel" is either , or . - /// - /// - /// - /// - void OnScrollWheel(InputAction.CallbackContext context); - /// - /// Method invoked when associated input action "TrackedDevicePosition" is either , or . - /// - /// - /// - /// - void OnTrackedDevicePosition(InputAction.CallbackContext context); - /// - /// Method invoked when associated input action "TrackedDeviceOrientation" is either , or . - /// - /// - /// - /// - void OnTrackedDeviceOrientation(InputAction.CallbackContext context); - } -} diff --git a/Assets/GameInputs.cs.meta b/Assets/GameInputs.cs.meta deleted file mode 100644 index 348ffc7..0000000 --- a/Assets/GameInputs.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 057d2bf293930d445b37a43054749679 \ No newline at end of file diff --git a/Assets/GameInputs.inputactions b/Assets/GameInputs.inputactions deleted file mode 100644 index c9cff82..0000000 --- a/Assets/GameInputs.inputactions +++ /dev/null @@ -1,612 +0,0 @@ -{ - "version": 1, - "name": "GameInputs", - "maps": [ - { - "name": "Player", - "id": "df70fa95-8a34-4494-b137-73ab6b9c7d37", - "actions": [ - { - "name": "Drag", - "type": "Value", - "id": "54e956de-82e3-4015-81a8-136684fb454d", - "expectedControlType": "", - "processors": "", - "interactions": "", - "initialStateCheck": true - } - ], - "bindings": [ - { - "name": "", - "id": "cd60ba9b-f92e-4ec7-bfb6-c97e1cccedab", - "path": "/touch0/delta", - "interactions": "", - "processors": "", - "groups": ";XR", - "action": "Drag", - "isComposite": false, - "isPartOfComposite": false - } - ] - }, - { - "name": "UI", - "id": "272f6d14-89ba-496f-b7ff-215263d3219f", - "actions": [ - { - "name": "Navigate", - "type": "PassThrough", - "id": "c95b2375-e6d9-4b88-9c4c-c5e76515df4b", - "expectedControlType": "Vector2", - "processors": "", - "interactions": "", - "initialStateCheck": false - }, - { - "name": "Submit", - "type": "Button", - "id": "7607c7b6-cd76-4816-beef-bd0341cfe950", - "expectedControlType": "Button", - "processors": "", - "interactions": "", - "initialStateCheck": false - }, - { - "name": "Cancel", - "type": "Button", - "id": "15cef263-9014-4fd5-94d9-4e4a6234a6ef", - "expectedControlType": "Button", - "processors": "", - "interactions": "", - "initialStateCheck": false - }, - { - "name": "Point", - "type": "PassThrough", - "id": "32b35790-4ed0-4e9a-aa41-69ac6d629449", - "expectedControlType": "Vector2", - "processors": "", - "interactions": "", - "initialStateCheck": true - }, - { - "name": "Click", - "type": "PassThrough", - "id": "3c7022bf-7922-4f7c-a998-c437916075ad", - "expectedControlType": "Button", - "processors": "", - "interactions": "", - "initialStateCheck": true - }, - { - "name": "RightClick", - "type": "PassThrough", - "id": "44b200b1-1557-4083-816c-b22cbdf77ddf", - "expectedControlType": "Button", - "processors": "", - "interactions": "", - "initialStateCheck": false - }, - { - "name": "MiddleClick", - "type": "PassThrough", - "id": "dad70c86-b58c-4b17-88ad-f5e53adf419e", - "expectedControlType": "Button", - "processors": "", - "interactions": "", - "initialStateCheck": false - }, - { - "name": "ScrollWheel", - "type": "PassThrough", - "id": "0489e84a-4833-4c40-bfae-cea84b696689", - "expectedControlType": "Vector2", - "processors": "", - "interactions": "", - "initialStateCheck": false - }, - { - "name": "TrackedDevicePosition", - "type": "PassThrough", - "id": "24908448-c609-4bc3-a128-ea258674378a", - "expectedControlType": "Vector3", - "processors": "", - "interactions": "", - "initialStateCheck": false - }, - { - "name": "TrackedDeviceOrientation", - "type": "PassThrough", - "id": "9caa3d8a-6b2f-4e8e-8bad-6ede561bd9be", - "expectedControlType": "Quaternion", - "processors": "", - "interactions": "", - "initialStateCheck": false - } - ], - "bindings": [ - { - "name": "Gamepad", - "id": "809f371f-c5e2-4e7a-83a1-d867598f40dd", - "path": "2DVector", - "interactions": "", - "processors": "", - "groups": "", - "action": "Navigate", - "isComposite": true, - "isPartOfComposite": false - }, - { - "name": "up", - "id": "14a5d6e8-4aaf-4119-a9ef-34b8c2c548bf", - "path": "/leftStick/up", - "interactions": "", - "processors": "", - "groups": ";Gamepad", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "up", - "id": "9144cbe6-05e1-4687-a6d7-24f99d23dd81", - "path": "/rightStick/up", - "interactions": "", - "processors": "", - "groups": ";Gamepad", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "down", - "id": "2db08d65-c5fb-421b-983f-c71163608d67", - "path": "/leftStick/down", - "interactions": "", - "processors": "", - "groups": ";Gamepad", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "down", - "id": "58748904-2ea9-4a80-8579-b500e6a76df8", - "path": "/rightStick/down", - "interactions": "", - "processors": "", - "groups": ";Gamepad", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "left", - "id": "8ba04515-75aa-45de-966d-393d9bbd1c14", - "path": "/leftStick/left", - "interactions": "", - "processors": "", - "groups": ";Gamepad", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "left", - "id": "712e721c-bdfb-4b23-a86c-a0d9fcfea921", - "path": "/rightStick/left", - "interactions": "", - "processors": "", - "groups": ";Gamepad", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "right", - "id": "fcd248ae-a788-4676-a12e-f4d81205600b", - "path": "/leftStick/right", - "interactions": "", - "processors": "", - "groups": ";Gamepad", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "right", - "id": "1f04d9bc-c50b-41a1-bfcc-afb75475ec20", - "path": "/rightStick/right", - "interactions": "", - "processors": "", - "groups": ";Gamepad", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "", - "id": "fb8277d4-c5cd-4663-9dc7-ee3f0b506d90", - "path": "/dpad", - "interactions": "", - "processors": "", - "groups": ";Gamepad", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": false - }, - { - "name": "Joystick", - "id": "e25d9774-381c-4a61-b47c-7b6b299ad9f9", - "path": "2DVector", - "interactions": "", - "processors": "", - "groups": "", - "action": "Navigate", - "isComposite": true, - "isPartOfComposite": false - }, - { - "name": "up", - "id": "3db53b26-6601-41be-9887-63ac74e79d19", - "path": "/stick/up", - "interactions": "", - "processors": "", - "groups": "Joystick", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "down", - "id": "0cb3e13e-3d90-4178-8ae6-d9c5501d653f", - "path": "/stick/down", - "interactions": "", - "processors": "", - "groups": "Joystick", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "left", - "id": "0392d399-f6dd-4c82-8062-c1e9c0d34835", - "path": "/stick/left", - "interactions": "", - "processors": "", - "groups": "Joystick", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "right", - "id": "942a66d9-d42f-43d6-8d70-ecb4ba5363bc", - "path": "/stick/right", - "interactions": "", - "processors": "", - "groups": "Joystick", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "Keyboard", - "id": "ff527021-f211-4c02-933e-5976594c46ed", - "path": "2DVector", - "interactions": "", - "processors": "", - "groups": "", - "action": "Navigate", - "isComposite": true, - "isPartOfComposite": false - }, - { - "name": "up", - "id": "563fbfdd-0f09-408d-aa75-8642c4f08ef0", - "path": "/w", - "interactions": "", - "processors": "", - "groups": "Keyboard&Mouse", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "up", - "id": "eb480147-c587-4a33-85ed-eb0ab9942c43", - "path": "/upArrow", - "interactions": "", - "processors": "", - "groups": "Keyboard&Mouse", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "down", - "id": "2bf42165-60bc-42ca-8072-8c13ab40239b", - "path": "/s", - "interactions": "", - "processors": "", - "groups": "Keyboard&Mouse", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "down", - "id": "85d264ad-e0a0-4565-b7ff-1a37edde51ac", - "path": "/downArrow", - "interactions": "", - "processors": "", - "groups": "Keyboard&Mouse", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "left", - "id": "74214943-c580-44e4-98eb-ad7eebe17902", - "path": "/a", - "interactions": "", - "processors": "", - "groups": "Keyboard&Mouse", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "left", - "id": "cea9b045-a000-445b-95b8-0c171af70a3b", - "path": "/leftArrow", - "interactions": "", - "processors": "", - "groups": "Keyboard&Mouse", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "right", - "id": "8607c725-d935-4808-84b1-8354e29bab63", - "path": "/d", - "interactions": "", - "processors": "", - "groups": "Keyboard&Mouse", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "right", - "id": "4cda81dc-9edd-4e03-9d7c-a71a14345d0b", - "path": "/rightArrow", - "interactions": "", - "processors": "", - "groups": "Keyboard&Mouse", - "action": "Navigate", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "", - "id": "9e92bb26-7e3b-4ec4-b06b-3c8f8e498ddc", - "path": "*/{Submit}", - "interactions": "", - "processors": "", - "groups": "Keyboard&Mouse;Gamepad;Touch;Joystick;XR", - "action": "Submit", - "isComposite": false, - "isPartOfComposite": false - }, - { - "name": "", - "id": "82627dcc-3b13-4ba9-841d-e4b746d6553e", - "path": "*/{Cancel}", - "interactions": "", - "processors": "", - "groups": "Keyboard&Mouse;Gamepad;Touch;Joystick;XR", - "action": "Cancel", - "isComposite": false, - "isPartOfComposite": false - }, - { - "name": "", - "id": "c52c8e0b-8179-41d3-b8a1-d149033bbe86", - "path": "/position", - "interactions": "", - "processors": "", - "groups": "Keyboard&Mouse", - "action": "Point", - "isComposite": false, - "isPartOfComposite": false - }, - { - "name": "", - "id": "e1394cbc-336e-44ce-9ea8-6007ed6193f7", - "path": "/position", - "interactions": "", - "processors": "", - "groups": "Keyboard&Mouse", - "action": "Point", - "isComposite": false, - "isPartOfComposite": false - }, - { - "name": "", - "id": "5693e57a-238a-46ed-b5ae-e64e6e574302", - "path": "/touch*/position", - "interactions": "", - "processors": "", - "groups": "Touch", - "action": "Point", - "isComposite": false, - "isPartOfComposite": false - }, - { - "name": "", - "id": "4faf7dc9-b979-4210-aa8c-e808e1ef89f5", - "path": "/leftButton", - "interactions": "", - "processors": "", - "groups": ";Keyboard&Mouse", - "action": "Click", - "isComposite": false, - "isPartOfComposite": false - }, - { - "name": "", - "id": "8d66d5ba-88d7-48e6-b1cd-198bbfef7ace", - "path": "/tip", - "interactions": "", - "processors": "", - "groups": ";Keyboard&Mouse", - "action": "Click", - "isComposite": false, - "isPartOfComposite": false - }, - { - "name": "", - "id": "47c2a644-3ebc-4dae-a106-589b7ca75b59", - "path": "/touch*/press", - "interactions": "", - "processors": "", - "groups": "Touch", - "action": "Click", - "isComposite": false, - "isPartOfComposite": false - }, - { - "name": "", - "id": "bb9e6b34-44bf-4381-ac63-5aa15d19f677", - "path": "/trigger", - "interactions": "", - "processors": "", - "groups": "XR", - "action": "Click", - "isComposite": false, - "isPartOfComposite": false - }, - { - "name": "", - "id": "38c99815-14ea-4617-8627-164d27641299", - "path": "/scroll", - "interactions": "", - "processors": "", - "groups": ";Keyboard&Mouse", - "action": "ScrollWheel", - "isComposite": false, - "isPartOfComposite": false - }, - { - "name": "", - "id": "4c191405-5738-4d4b-a523-c6a301dbf754", - "path": "/rightButton", - "interactions": "", - "processors": "", - "groups": "Keyboard&Mouse", - "action": "RightClick", - "isComposite": false, - "isPartOfComposite": false - }, - { - "name": "", - "id": "24066f69-da47-44f3-a07e-0015fb02eb2e", - "path": "/middleButton", - "interactions": "", - "processors": "", - "groups": "Keyboard&Mouse", - "action": "MiddleClick", - "isComposite": false, - "isPartOfComposite": false - }, - { - "name": "", - "id": "7236c0d9-6ca3-47cf-a6ee-a97f5b59ea77", - "path": "/devicePosition", - "interactions": "", - "processors": "", - "groups": "XR", - "action": "TrackedDevicePosition", - "isComposite": false, - "isPartOfComposite": false - }, - { - "name": "", - "id": "23e01e3a-f935-4948-8d8b-9bcac77714fb", - "path": "/deviceRotation", - "interactions": "", - "processors": "", - "groups": "XR", - "action": "TrackedDeviceOrientation", - "isComposite": false, - "isPartOfComposite": false - } - ] - } - ], - "controlSchemes": [ - { - "name": "Keyboard&Mouse", - "bindingGroup": "Keyboard&Mouse", - "devices": [ - { - "devicePath": "", - "isOptional": false, - "isOR": false - }, - { - "devicePath": "", - "isOptional": false, - "isOR": false - } - ] - }, - { - "name": "Gamepad", - "bindingGroup": "Gamepad", - "devices": [ - { - "devicePath": "", - "isOptional": false, - "isOR": false - } - ] - }, - { - "name": "Touch", - "bindingGroup": "Touch", - "devices": [ - { - "devicePath": "", - "isOptional": false, - "isOR": false - } - ] - }, - { - "name": "Joystick", - "bindingGroup": "Joystick", - "devices": [ - { - "devicePath": "", - "isOptional": false, - "isOR": false - } - ] - }, - { - "name": "XR", - "bindingGroup": "XR", - "devices": [ - { - "devicePath": "", - "isOptional": false, - "isOR": false - } - ] - } - ] -} \ No newline at end of file diff --git a/Assets/InputReaderSO.asset b/Assets/InputReaderSO.asset new file mode 100644 index 0000000..c518e44 --- /dev/null +++ b/Assets/InputReaderSO.asset @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4a3c33239e86293489f00da63bb17b7b, type: 3} + m_Name: InputReaderSO + m_EditorClassIdentifier: Assembly-CSharp::InputReader + _dragInput: {x: 0, y: 0} diff --git a/Assets/InputReaderSO.asset.meta b/Assets/InputReaderSO.asset.meta new file mode 100644 index 0000000..175b2b3 --- /dev/null +++ b/Assets/InputReaderSO.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2a2b417a57682e641bf83db51511deac +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Materials/Green.mat b/Assets/Resources/Materials/Green.mat index d8f8008..76feeb4 100644 --- a/Assets/Resources/Materials/Green.mat +++ b/Assets/Resources/Materials/Green.mat @@ -28,7 +28,7 @@ Material: - _SPECULAR_SETUP m_InvalidKeywords: [] m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 + m_EnableInstancingVariants: 1 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: diff --git a/Assets/Resources/Materials/Red.mat b/Assets/Resources/Materials/Red.mat index 540bf22..d55a5f9 100644 --- a/Assets/Resources/Materials/Red.mat +++ b/Assets/Resources/Materials/Red.mat @@ -28,7 +28,7 @@ Material: - _SPECULAR_SETUP m_InvalidKeywords: [] m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 + m_EnableInstancingVariants: 1 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: diff --git a/Assets/Resources/Materials/Tower.mat b/Assets/Resources/Materials/Tower.mat index 748e413..2cff1b7 100644 --- a/Assets/Resources/Materials/Tower.mat +++ b/Assets/Resources/Materials/Tower.mat @@ -15,7 +15,7 @@ Material: - _SPECULAR_SETUP m_InvalidKeywords: [] m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 + m_EnableInstancingVariants: 1 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: diff --git a/Assets/Resources/Materials/White.mat b/Assets/Resources/Materials/White.mat new file mode 100644 index 0000000..53bef88 --- /dev/null +++ b/Assets/Resources/Materials/White.mat @@ -0,0 +1,137 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: White + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: + RenderType: Opaque + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EnvironmentReflections: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.005 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 + - _WorkflowMode: 1 + - _XRMotionVectorsPass: 1 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &3629057849019872169 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 diff --git a/Assets/Resources/Materials/White.mat.meta b/Assets/Resources/Materials/White.mat.meta new file mode 100644 index 0000000..620192c --- /dev/null +++ b/Assets/Resources/Materials/White.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: db21fe47f6e7ece46a4106f3f3c551d0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/PlatformPrefabs/PlatformPiece (1).prefab b/Assets/Resources/PlatformPrefabs/PlatformPiece (1).prefab index 8baa179..d0bab7b 100644 --- a/Assets/Resources/PlatformPrefabs/PlatformPiece (1).prefab +++ b/Assets/Resources/PlatformPrefabs/PlatformPiece (1).prefab @@ -14,7 +14,7 @@ GameObject: - component: {fileID: 2963519295179537184} m_Layer: 0 m_Name: Circle.004 - m_TagString: Platform + m_TagString: Death m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -67,7 +67,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 97b18b5a446e9f54692a651543b48e8d, type: 2} + - {fileID: 2100000, guid: f707c41b0269f41469470c60b514faeb, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Resources/PlatformPrefabs/PlatformPiece (2).prefab b/Assets/Resources/PlatformPrefabs/PlatformPiece (2).prefab index 04323ea..315c242 100644 --- a/Assets/Resources/PlatformPrefabs/PlatformPiece (2).prefab +++ b/Assets/Resources/PlatformPrefabs/PlatformPiece (2).prefab @@ -180,7 +180,7 @@ GameObject: - component: {fileID: 8731784961809086278} m_Layer: 0 m_Name: Circle.005 - m_TagString: Platform + m_TagString: Death m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -233,7 +233,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 97b18b5a446e9f54692a651543b48e8d, type: 2} + - {fileID: 2100000, guid: f707c41b0269f41469470c60b514faeb, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Resources/PlatformPrefabs/PlatformPiece (3).prefab b/Assets/Resources/PlatformPrefabs/PlatformPiece (3).prefab index cfe1a85..4b9bd04 100644 --- a/Assets/Resources/PlatformPrefabs/PlatformPiece (3).prefab +++ b/Assets/Resources/PlatformPrefabs/PlatformPiece (3).prefab @@ -180,7 +180,7 @@ GameObject: - component: {fileID: 6956209735994543253} m_Layer: 0 m_Name: Circle.005 - m_TagString: Platform + m_TagString: Death m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -233,7 +233,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 97b18b5a446e9f54692a651543b48e8d, type: 2} + - {fileID: 2100000, guid: f707c41b0269f41469470c60b514faeb, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -633,7 +633,7 @@ GameObject: - component: {fileID: 5526949325561151518} m_Layer: 0 m_Name: Circle.007 - m_TagString: Platform + m_TagString: Death m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -686,7 +686,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 97b18b5a446e9f54692a651543b48e8d, type: 2} + - {fileID: 2100000, guid: f707c41b0269f41469470c60b514faeb, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Resources/PlatformPrefabs/PlatformPiece (4).prefab b/Assets/Resources/PlatformPrefabs/PlatformPiece (4).prefab index 6ab54fc..3b4fc0c 100644 --- a/Assets/Resources/PlatformPrefabs/PlatformPiece (4).prefab +++ b/Assets/Resources/PlatformPrefabs/PlatformPiece (4).prefab @@ -972,7 +972,7 @@ GameObject: - component: {fileID: 6995019004130593180} m_Layer: 0 m_Name: Circle.001 - m_TagString: Platform + m_TagString: Death m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -1025,7 +1025,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 97b18b5a446e9f54692a651543b48e8d, type: 2} + - {fileID: 2100000, guid: f707c41b0269f41469470c60b514faeb, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Resources/PlatformPrefabs/PlatformPiece (5).prefab b/Assets/Resources/PlatformPrefabs/PlatformPiece (5).prefab index 08d6391..05b6940 100644 --- a/Assets/Resources/PlatformPrefabs/PlatformPiece (5).prefab +++ b/Assets/Resources/PlatformPrefabs/PlatformPiece (5).prefab @@ -14,7 +14,7 @@ GameObject: - component: {fileID: 6076096134518381890} m_Layer: 0 m_Name: Circle.002 - m_TagString: Platform + m_TagString: Death m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -67,7 +67,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 97b18b5a446e9f54692a651543b48e8d, type: 2} + - {fileID: 2100000, guid: f707c41b0269f41469470c60b514faeb, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -127,7 +127,7 @@ GameObject: - component: {fileID: 4683809600451703336} m_Layer: 0 m_Name: Circle.007 - m_TagString: Platform + m_TagString: Death m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -180,7 +180,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 97b18b5a446e9f54692a651543b48e8d, type: 2} + - {fileID: 2100000, guid: f707c41b0269f41469470c60b514faeb, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Resources/PlatformPrefabs/PlatformPiece.prefab b/Assets/Resources/PlatformPrefabs/PlatformPiece.prefab index 0f53381..1966a53 100644 --- a/Assets/Resources/PlatformPrefabs/PlatformPiece.prefab +++ b/Assets/Resources/PlatformPrefabs/PlatformPiece.prefab @@ -353,7 +353,7 @@ GameObject: - component: {fileID: 8116566647748522931} m_Layer: 0 m_Name: Circle.002 - m_TagString: Platform + m_TagString: Death m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -406,7 +406,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 97b18b5a446e9f54692a651543b48e8d, type: 2} + - {fileID: 2100000, guid: f707c41b0269f41469470c60b514faeb, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -580,7 +580,7 @@ GameObject: - component: {fileID: 4611543159595422234} m_Layer: 0 m_Name: Circle.005 - m_TagString: Platform + m_TagString: Death m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -633,7 +633,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 97b18b5a446e9f54692a651543b48e8d, type: 2} + - {fileID: 2100000, guid: f707c41b0269f41469470c60b514faeb, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Resources/PlayerBall.prefab b/Assets/Resources/PlayerBall.prefab new file mode 100644 index 0000000..c122757 --- /dev/null +++ b/Assets/Resources/PlayerBall.prefab @@ -0,0 +1,157 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3842089911828763729 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6651823975399603996} + - component: {fileID: 1240663307313507871} + - component: {fileID: 4247256402236073772} + - component: {fileID: 5266415683860412034} + - component: {fileID: 6666386226637979592} + - component: {fileID: 519856185226624944} + m_Layer: 0 + m_Name: PlayerBall + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6651823975399603996 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3842089911828763729} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: -0.6} + m_LocalScale: {x: 0.15, y: 0.15, z: 0.15} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1240663307313507871 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3842089911828763729} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &4247256402236073772 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3842089911828763729} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: f707c41b0269f41469470c60b514faeb, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &5266415683860412034 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3842089911828763729} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!54 &6666386226637979592 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3842089911828763729} + serializedVersion: 5 + m_Mass: 1 + m_LinearDamping: 0 + m_AngularDamping: 0.05 + m_CenterOfMass: {x: 0, y: 0, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 1 + m_ImplicitTensor: 1 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 1 + m_Constraints: 122 + m_CollisionDetection: 1 +--- !u!114 &519856185226624944 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3842089911828763729} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a23214d81cfb862488bd856cfdffb896, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Player + jumpforce: 4 + BallRb: {fileID: 6666386226637979592} diff --git a/Assets/Resources/PlayerBall.prefab.meta b/Assets/Resources/PlayerBall.prefab.meta new file mode 100644 index 0000000..5232b6a --- /dev/null +++ b/Assets/Resources/PlayerBall.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0f97df0e7c40fd24a95147178f49e02c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index c963c56..0512d97 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -198,6 +198,7 @@ MonoBehaviour: TypeName: autoRun: 1 autoInjectGameObjects: [] + _inputReader: {fileID: 11400000, guid: 2a2b417a57682e641bf83db51511deac, type: 2} --- !u!1 &330585543 GameObject: m_ObjectHideFlags: 0 @@ -210,7 +211,6 @@ GameObject: - component: {fileID: 330585545} - component: {fileID: 330585544} - component: {fileID: 330585547} - - component: {fileID: 330585548} - component: {fileID: 330585549} m_Layer: 0 m_Name: Main Camera @@ -236,8 +236,8 @@ Camera: m_GameObject: {fileID: 330585543} m_Enabled: 1 serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.18983625, g: 0.49099573, b: 0.509434, a: 0} m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 @@ -286,13 +286,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 330585543} serializedVersion: 2 - m_LocalRotation: {x: 0.2297529, y: 0.00000002295013, z: -0.0000000054177907, w: 0.973249} - m_LocalPosition: {x: 0, y: 1.5, z: -4.6} + m_LocalRotation: {x: 0.22975297, y: -0.0000000030881466, z: 7.2901263e-10, w: 0.973249} + m_LocalPosition: {x: 0, y: 3, z: -4.8} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 20, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 26.565, y: 3, z: 0} --- !u!114 &330585547 MonoBehaviour: m_ObjectHideFlags: 0 @@ -337,21 +337,6 @@ MonoBehaviour: m_VarianceClampScale: 0.9 m_ContrastAdaptiveSharpening: 0 m_Version: 2 ---- !u!114 &330585548 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 330585543} - m_Enabled: 0 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b94916e2493e48f488767bcbbb9e3788, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::CameraController - target: {fileID: 2070186952} - smoothSpeed: 5 - yOffset: 1 --- !u!114 &330585549 MonoBehaviour: m_ObjectHideFlags: 0 @@ -652,7 +637,7 @@ MonoBehaviour: m_StreamingVersion: 20241001 m_LegacyPriority: 0 Target: - TrackingTarget: {fileID: 2070186952} + TrackingTarget: {fileID: 2076289626} LookAtTarget: {fileID: 0} CustomLookAtTarget: 0 Lens: @@ -683,13 +668,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 470208923} serializedVersion: 2 - m_LocalRotation: {x: 0.22975288, y: 0.000000022950132, z: -0.0000000054177907, w: 0.973249} - m_LocalPosition: {x: 0, y: 1.5, z: -4.6} + m_LocalRotation: {x: 0.22975294, y: -0.00000000295228, z: 1.5347404e-10, w: 0.973249} + m_LocalPosition: {x: 0, y: 3, z: -4.8} 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_LocalEulerAnglesHint: {x: 26.565, y: 3, z: 0} --- !u!1 &725044586 GameObject: m_ObjectHideFlags: 0 @@ -736,6 +721,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5581fca74af43824995a825437415c12, type: 3} m_Name: m_EditorClassIdentifier: Assembly-CSharp::PlatfromManager + rotspeed: 1 --- !u!1 &832575517 GameObject: m_ObjectHideFlags: 0 @@ -785,64 +771,160 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &2070186948 +--- !u!1001 &2033757665 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1975457108487340, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_Name + value: Soccer Ball + objectReference: {fileID: 0} + - target: {fileID: 1975457108487340, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1975457108487340, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_TagString + value: Player + objectReference: {fileID: 0} + - target: {fileID: 4935240531098310, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_LocalScale.x + value: 0.8 + objectReference: {fileID: 0} + - target: {fileID: 4935240531098310, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_LocalScale.y + value: 0.8 + objectReference: {fileID: 0} + - target: {fileID: 4935240531098310, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_LocalScale.z + value: 0.8 + objectReference: {fileID: 0} + - target: {fileID: 4935240531098310, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4935240531098310, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_LocalPosition.y + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 4935240531098310, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_LocalPosition.z + value: -0.8 + objectReference: {fileID: 0} + - target: {fileID: 4935240531098310, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4935240531098310, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4935240531098310, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4935240531098310, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4935240531098310, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4935240531098310, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4935240531098310, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 1975457108487340, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + insertIndex: -1 + addedObject: {fileID: 2076289628} + - targetCorrespondingSourceObject: {fileID: 1975457108487340, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + insertIndex: -1 + addedObject: {fileID: 2076289627} + - targetCorrespondingSourceObject: {fileID: 1975457108487340, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + insertIndex: -1 + addedObject: {fileID: 2076289629} + m_SourcePrefab: {fileID: 100100000, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} +--- !u!1 &2076289622 stripped GameObject: + m_CorrespondingSourceObject: {fileID: 1975457108487340, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + m_PrefabInstance: {fileID: 2033757665} + m_PrefabAsset: {fileID: 0} +--- !u!4 &2076289626 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4935240531098310, guid: ec3e8f3ed27e2244caaedaf589590a03, type: 3} + m_PrefabInstance: {fileID: 2033757665} + m_PrefabAsset: {fileID: 0} +--- !u!54 &2076289627 +Rigidbody: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2070186952} - - component: {fileID: 2070186951} - - component: {fileID: 2070186950} - - component: {fileID: 2070186949} - - component: {fileID: 2070186953} - - component: {fileID: 2070186954} - m_Layer: 0 - m_Name: PlayerBall - m_TagString: Player - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!135 &2070186949 -SphereCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2070186948} - m_Material: {fileID: 0} + m_GameObject: {fileID: 2076289622} + serializedVersion: 5 + m_Mass: 1 + m_LinearDamping: 0 + m_AngularDamping: 0.05 + m_CenterOfMass: {x: 0, y: 0, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} m_IncludeLayers: serializedVersion: 2 m_Bits: 0 m_ExcludeLayers: serializedVersion: 2 m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 0 - m_ProvidesContacts: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Radius: 0.5 - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &2070186950 -MeshRenderer: + m_ImplicitCom: 1 + m_ImplicitTensor: 1 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 1 + m_Constraints: 122 + m_CollisionDetection: 1 +--- !u!114 &2076289628 +MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2070186948} + m_GameObject: {fileID: 2076289622} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a23214d81cfb862488bd856cfdffb896, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Player + jumpforce: 3 + BallRb: {fileID: 2076289627} +--- !u!96 &2076289629 +TrailRenderer: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2076289622} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 m_StaticShadowCaster: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 @@ -852,7 +934,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: f707c41b0269f41469470c60b514faeb, type: 2} + - {fileID: 2100000, guid: db21fe47f6e7ece46a4106f3f3c551d0, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -875,71 +957,76 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_MaskInteraction: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &2070186951 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2070186948} - m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &2070186952 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2070186948} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0.5, z: -0.6} - m_LocalScale: {x: 0.15, y: 0.15, z: 0.15} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!54 &2070186953 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2070186948} - serializedVersion: 5 - m_Mass: 1 - m_LinearDamping: 0 - m_AngularDamping: 0.05 - m_CenterOfMass: {x: 0, y: 0, z: 0} - m_InertiaTensor: {x: 1, y: 1, z: 1} - m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ImplicitCom: 1 - m_ImplicitTensor: 1 - m_UseGravity: 1 - m_IsKinematic: 0 - m_Interpolate: 1 - m_Constraints: 122 - m_CollisionDetection: 1 ---- !u!114 &2070186954 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2070186948} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 747f7dce18fb6a548bafaf8388f331e4, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::JumpingBall - jumpforce: 3 - BallRb: {fileID: 2070186953} + m_Time: 0.2 + m_PreviewTimeScale: 1 + m_Parameters: + serializedVersion: 3 + widthMultiplier: 1 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0.0060043335 + value: 0.13697745 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 0, g: 0, b: 0, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 30455 + ctime2: 41441 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + numCornerVertices: 0 + numCapVertices: 0 + alignment: 0 + textureMode: 0 + textureScale: {x: 1, y: 1} + shadowBias: 0.5 + generateLightingData: 0 + m_MinVertexDistance: 0.1 + m_Autodestruct: 0 + m_Emitting: 1 + m_ApplyActiveColorSpace: 1 --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 @@ -947,7 +1034,7 @@ SceneRoots: - {fileID: 410087041} - {fileID: 832575519} - {fileID: 330585546} - - {fileID: 2070186952} + - {fileID: 470208927} + - {fileID: 2033757665} - {fileID: 725044587} - {fileID: 326808876} - - {fileID: 470208927} diff --git a/Assets/Scripts/GameInput.meta b/Assets/Scripts/GameInput.meta new file mode 100644 index 0000000..5a93907 --- /dev/null +++ b/Assets/Scripts/GameInput.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0dc1d6ab2941b194184f854b7f1a3c75 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/GameInput/GameInput.cs b/Assets/Scripts/GameInput/GameInput.cs new file mode 100644 index 0000000..f8400f5 --- /dev/null +++ b/Assets/Scripts/GameInput/GameInput.cs @@ -0,0 +1,323 @@ +//------------------------------------------------------------------------------ +// +// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator +// version 1.16.0 +// from Assets/Scripts/GameInput/GameInput.inputactions +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine.InputSystem; +using UnityEngine.InputSystem.Utilities; + +/// +/// Provides programmatic access to , , and instances defined in asset "Assets/Scripts/GameInput/GameInput.inputactions". +/// +/// +/// This class is source generated and any manual edits will be discarded if the associated asset is reimported or modified. +/// +/// +/// +/// using namespace UnityEngine; +/// using UnityEngine.InputSystem; +/// +/// // Example of using an InputActionMap named "Player" from a UnityEngine.MonoBehaviour implementing callback interface. +/// public class Example : MonoBehaviour, MyActions.IPlayerActions +/// { +/// private MyActions_Actions m_Actions; // Source code representation of asset. +/// private MyActions_Actions.PlayerActions m_Player; // Source code representation of action map. +/// +/// void Awake() +/// { +/// m_Actions = new MyActions_Actions(); // Create asset object. +/// m_Player = m_Actions.Player; // Extract action map object. +/// m_Player.AddCallbacks(this); // Register callback interface IPlayerActions. +/// } +/// +/// void OnDestroy() +/// { +/// m_Actions.Dispose(); // Destroy asset object. +/// } +/// +/// void OnEnable() +/// { +/// m_Player.Enable(); // Enable all actions within map. +/// } +/// +/// void OnDisable() +/// { +/// m_Player.Disable(); // Disable all actions within map. +/// } +/// +/// #region Interface implementation of MyActions.IPlayerActions +/// +/// // Invoked when "Move" action is either started, performed or canceled. +/// public void OnMove(InputAction.CallbackContext context) +/// { +/// Debug.Log($"OnMove: {context.ReadValue<Vector2>()}"); +/// } +/// +/// // Invoked when "Attack" action is either started, performed or canceled. +/// public void OnAttack(InputAction.CallbackContext context) +/// { +/// Debug.Log($"OnAttack: {context.ReadValue<float>()}"); +/// } +/// +/// #endregion +/// } +/// +/// +public partial class @GameInput: IInputActionCollection2, IDisposable +{ + /// + /// Provides access to the underlying asset instance. + /// + public InputActionAsset asset { get; } + + /// + /// Constructs a new instance. + /// + public @GameInput() + { + asset = InputActionAsset.FromJson(@"{ + ""version"": 1, + ""name"": ""GameInput"", + ""maps"": [ + { + ""name"": ""Player"", + ""id"": ""843e6a41-5f3f-41a7-babf-23aad7346cc5"", + ""actions"": [ + { + ""name"": ""Drag"", + ""type"": ""PassThrough"", + ""id"": ""838180ae-e461-4653-a2e3-17ffb634a89d"", + ""expectedControlType"": ""Vector2"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": true + } + ], + ""bindings"": [ + { + ""name"": """", + ""id"": ""131b8ff7-9803-469f-bd97-edc6236ff88a"", + ""path"": ""/touch0/delta"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Drag"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""50de849f-4620-498a-b592-9dc32d7036c4"", + ""path"": ""/delta"", + ""interactions"": ""Press"", + ""processors"": """", + ""groups"": """", + ""action"": ""Drag"", + ""isComposite"": false, + ""isPartOfComposite"": false + } + ] + } + ], + ""controlSchemes"": [] +}"); + // Player + m_Player = asset.FindActionMap("Player", throwIfNotFound: true); + m_Player_Drag = m_Player.FindAction("Drag", throwIfNotFound: true); + } + + ~@GameInput() + { + UnityEngine.Debug.Assert(!m_Player.enabled, "This will cause a leak and performance issues, GameInput.Player.Disable() has not been called."); + } + + /// + /// Destroys this asset and all associated instances. + /// + public void Dispose() + { + UnityEngine.Object.Destroy(asset); + } + + /// + public InputBinding? bindingMask + { + get => asset.bindingMask; + set => asset.bindingMask = value; + } + + /// + public ReadOnlyArray? devices + { + get => asset.devices; + set => asset.devices = value; + } + + /// + public ReadOnlyArray controlSchemes => asset.controlSchemes; + + /// + public bool Contains(InputAction action) + { + return asset.Contains(action); + } + + /// + public IEnumerator GetEnumerator() + { + return asset.GetEnumerator(); + } + + /// + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// + public void Enable() + { + asset.Enable(); + } + + /// + public void Disable() + { + asset.Disable(); + } + + /// + public IEnumerable 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); + } + + // Player + private readonly InputActionMap m_Player; + private List m_PlayerActionsCallbackInterfaces = new List(); + private readonly InputAction m_Player_Drag; + /// + /// Provides access to input actions defined in input action map "Player". + /// + public struct PlayerActions + { + private @GameInput m_Wrapper; + + /// + /// Construct a new instance of the input action map wrapper class. + /// + public PlayerActions(@GameInput wrapper) { m_Wrapper = wrapper; } + /// + /// Provides access to the underlying input action "Player/Drag". + /// + public InputAction @Drag => m_Wrapper.m_Player_Drag; + /// + /// Provides access to the underlying input action map instance. + /// + public InputActionMap Get() { return m_Wrapper.m_Player; } + /// + public void Enable() { Get().Enable(); } + /// + public void Disable() { Get().Disable(); } + /// + public bool enabled => Get().enabled; + /// + /// Implicitly converts an to an instance. + /// + public static implicit operator InputActionMap(PlayerActions set) { return set.Get(); } + /// + /// Adds , and callbacks provided via on all input actions contained in this map. + /// + /// Callback instance. + /// + /// If is null or have already been added this method does nothing. + /// + /// + public void AddCallbacks(IPlayerActions instance) + { + if (instance == null || m_Wrapper.m_PlayerActionsCallbackInterfaces.Contains(instance)) return; + m_Wrapper.m_PlayerActionsCallbackInterfaces.Add(instance); + @Drag.started += instance.OnDrag; + @Drag.performed += instance.OnDrag; + @Drag.canceled += instance.OnDrag; + } + + /// + /// Removes , and callbacks provided via on all input actions contained in this map. + /// + /// + /// Calling this method when have not previously been registered has no side-effects. + /// + /// + private void UnregisterCallbacks(IPlayerActions instance) + { + @Drag.started -= instance.OnDrag; + @Drag.performed -= instance.OnDrag; + @Drag.canceled -= instance.OnDrag; + } + + /// + /// Unregisters and unregisters all input action callbacks via . + /// + /// + public void RemoveCallbacks(IPlayerActions instance) + { + if (m_Wrapper.m_PlayerActionsCallbackInterfaces.Remove(instance)) + UnregisterCallbacks(instance); + } + + /// + /// Replaces all existing callback instances and previously registered input action callbacks associated with them with callbacks provided via . + /// + /// + /// If is null, calling this method will only unregister all existing callbacks but not register any new callbacks. + /// + /// + /// + /// + public void SetCallbacks(IPlayerActions instance) + { + foreach (var item in m_Wrapper.m_PlayerActionsCallbackInterfaces) + UnregisterCallbacks(item); + m_Wrapper.m_PlayerActionsCallbackInterfaces.Clear(); + AddCallbacks(instance); + } + } + /// + /// Provides a new instance referencing this action map. + /// + public PlayerActions @Player => new PlayerActions(this); + /// + /// Interface to implement callback methods for all input action callbacks associated with input actions defined by "Player" which allows adding and removing callbacks. + /// + /// + /// + public interface IPlayerActions + { + /// + /// Method invoked when associated input action "Drag" is either , or . + /// + /// + /// + /// + void OnDrag(InputAction.CallbackContext context); + } +} diff --git a/Assets/Scripts/GameInput/GameInput.cs.meta b/Assets/Scripts/GameInput/GameInput.cs.meta new file mode 100644 index 0000000..1c68c17 --- /dev/null +++ b/Assets/Scripts/GameInput/GameInput.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e12dddb05c8ef254d9f2e5846f83827d \ No newline at end of file diff --git a/Assets/Scripts/GameInput/GameInput.inputactions b/Assets/Scripts/GameInput/GameInput.inputactions new file mode 100644 index 0000000..6db1162 --- /dev/null +++ b/Assets/Scripts/GameInput/GameInput.inputactions @@ -0,0 +1,46 @@ +{ + "version": 1, + "name": "GameInput", + "maps": [ + { + "name": "Player", + "id": "843e6a41-5f3f-41a7-babf-23aad7346cc5", + "actions": [ + { + "name": "Drag", + "type": "PassThrough", + "id": "838180ae-e461-4653-a2e3-17ffb634a89d", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + } + ], + "bindings": [ + { + "name": "", + "id": "131b8ff7-9803-469f-bd97-edc6236ff88a", + "path": "/touch0/delta", + "interactions": "", + "processors": "", + "groups": "", + "action": "Drag", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "50de849f-4620-498a-b592-9dc32d7036c4", + "path": "/delta", + "interactions": "Press", + "processors": "", + "groups": "", + "action": "Drag", + "isComposite": false, + "isPartOfComposite": false + } + ] + } + ], + "controlSchemes": [] +} \ No newline at end of file diff --git a/Assets/GameInputs.inputactions.meta b/Assets/Scripts/GameInput/GameInput.inputactions.meta similarity index 89% rename from Assets/GameInputs.inputactions.meta rename to Assets/Scripts/GameInput/GameInput.inputactions.meta index e336413..dba6587 100644 --- a/Assets/GameInputs.inputactions.meta +++ b/Assets/Scripts/GameInput/GameInput.inputactions.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 052faaac586de48259a63d0c4782560b +guid: 809203ef385099e49a8f168a3c29879b ScriptedImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Scripts/IInputReader.cs b/Assets/Scripts/GameInput/IInputReader.cs similarity index 63% rename from Assets/Scripts/IInputReader.cs rename to Assets/Scripts/GameInput/IInputReader.cs index 7007f46..2cc2761 100644 --- a/Assets/Scripts/IInputReader.cs +++ b/Assets/Scripts/GameInput/IInputReader.cs @@ -2,5 +2,5 @@ using UnityEngine; public interface IInputReader { - Vector2 DragInput { get; } + Vector2 dragInput{get;} } diff --git a/Assets/Scripts/GameInput/IInputReader.cs.meta b/Assets/Scripts/GameInput/IInputReader.cs.meta new file mode 100644 index 0000000..5cc079d --- /dev/null +++ b/Assets/Scripts/GameInput/IInputReader.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c5a95c1688b1c994998a288e1fe772be \ No newline at end of file diff --git a/Assets/Scripts/GameInput/InputReader.cs b/Assets/Scripts/GameInput/InputReader.cs new file mode 100644 index 0000000..178ac09 --- /dev/null +++ b/Assets/Scripts/GameInput/InputReader.cs @@ -0,0 +1,40 @@ +using System; +using UnityEngine; +using UnityEngine.InputSystem; + +[CreateAssetMenu(fileName = "InputReader", menuName = "Scriptable Objects/InputReader")] +public class InputReader : ScriptableObject, IInputReader, GameInput.IPlayerActions +{ + public Action OnDragValueChanged; + public Vector2 _dragInput; + public Vector2 dragInput + { + get=> _dragInput; + private set + { + _dragInput = value; + OnDragValueChanged?.Invoke(_dragInput); + } + } + private GameInput inputActions; + + private void OnEnable() + { + if(inputActions==null) + { + inputActions = new GameInput(); + inputActions.Player.SetCallbacks(this); + } + inputActions.Enable(); + } + + private void OnDisable() + { + inputActions?.Player.Disable(); + } + + public void OnDrag(InputAction.CallbackContext context) + { + dragInput = context.ReadValue(); + } +} diff --git a/Assets/Scripts/GameInput/InputReader.cs.meta b/Assets/Scripts/GameInput/InputReader.cs.meta new file mode 100644 index 0000000..41edd60 --- /dev/null +++ b/Assets/Scripts/GameInput/InputReader.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4a3c33239e86293489f00da63bb17b7b \ No newline at end of file diff --git a/Assets/Scripts/IInputReader.cs.meta b/Assets/Scripts/IInputReader.cs.meta deleted file mode 100644 index 56d9a24..0000000 --- a/Assets/Scripts/IInputReader.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 4fd243b30ced38840a3173920b99929f \ No newline at end of file diff --git a/Assets/Scripts/InputReader.cs b/Assets/Scripts/InputReader.cs deleted file mode 100644 index a245242..0000000 --- a/Assets/Scripts/InputReader.cs +++ /dev/null @@ -1,26 +0,0 @@ -using UnityEngine; -using UnityEngine.InputSystem; -using static GameInputs; - -public class InputReader : ScriptableObject, IInputReader, IPlayerActions -{ - private GameInputs _inputActions; - - public Vector2 DragInput { get; private set;} - - void OnEnable() - { - if (_inputActions == null) - { - _inputActions = new GameInputs(); - _inputActions.Player.SetCallbacks(this); - } - _inputActions.Enable(); - } - public void OnDrag(InputAction.CallbackContext context) - { - DragInput = context.ReadValue(); - Debug.Log(DragInput); - } - -} diff --git a/Assets/Scripts/InputReader.cs.meta b/Assets/Scripts/InputReader.cs.meta deleted file mode 100644 index 4054291..0000000 --- a/Assets/Scripts/InputReader.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: bf23afefa375da349994d4977b4ffe60 \ No newline at end of file diff --git a/Assets/Scripts/LifeTimeScope/GameLifeTimeScope.cs b/Assets/Scripts/LifeTimeScope/GameLifeTimeScope.cs index 980c241..af42235 100644 --- a/Assets/Scripts/LifeTimeScope/GameLifeTimeScope.cs +++ b/Assets/Scripts/LifeTimeScope/GameLifeTimeScope.cs @@ -5,18 +5,13 @@ using VContainer.Unity; public class GameLifeTimeScope : LifetimeScope { - [SerializeField] private InputReader inputReader; + [SerializeField] private InputReader _inputReader; protected override void Configure(IContainerBuilder builder) { builder.RegisterComponentInHierarchy(); - builder.RegisterComponentInHierarchy(); + builder.RegisterComponentInHierarchy(); builder.RegisterComponentInHierarchy(); - builder.RegisterComponent(inputReader); - } - - public void IsWorking() - { - Debug.Log("True"); + builder.RegisterInstance(_inputReader).As(); } } diff --git a/Assets/Scripts/PlatformScript/Platform.cs b/Assets/Scripts/PlatformScript/Platform.cs index 7863ee5..066f9cf 100644 --- a/Assets/Scripts/PlatformScript/Platform.cs +++ b/Assets/Scripts/PlatformScript/Platform.cs @@ -7,12 +7,13 @@ public class Platform : MonoBehaviour private Transform playerTransform; [Inject] private PlatformPool pool; [Inject] private PlatformManager manager; - [Inject] private IInputReader inputReader; + [Inject] private Player player; + //[Inject] private IInputReader inputReader; void Start() { - playerTransform = GameObject.FindGameObjectWithTag("Player").transform; + playerTransform = player.transform; } void Update() diff --git a/Assets/Scripts/PlatformScript/PlatformManager.cs b/Assets/Scripts/PlatformScript/PlatformManager.cs index 155723e..3a8ad5c 100644 --- a/Assets/Scripts/PlatformScript/PlatformManager.cs +++ b/Assets/Scripts/PlatformScript/PlatformManager.cs @@ -1,3 +1,4 @@ +using System; using UnityEngine; using VContainer; @@ -5,13 +6,30 @@ public class PlatformManager : MonoBehaviour { private GameObject currentPlatfrom; [Inject] private PlatformPool pool; - + [Inject] private InputReader inputReader; private int yPos=0; + public int rotspeed = 1; + + void Start() { ShowInitialPlatforms(); } + private void OnEnable() + { + inputReader.OnDragValueChanged += DragPerformed; + } + private void OnDisable() + { + inputReader.OnDragValueChanged -= DragPerformed; + } + + private void DragPerformed(Vector2 drag) + { + float rotAmount = -drag.normalized.x * rotspeed; + transform.Rotate(0, rotAmount, 0); + } public void ShowInitialPlatforms() { diff --git a/Assets/Scripts/PlayerScript/IPlayer.cs b/Assets/Scripts/PlayerScript/IPlayer.cs new file mode 100644 index 0000000..61c215b --- /dev/null +++ b/Assets/Scripts/PlayerScript/IPlayer.cs @@ -0,0 +1,6 @@ +using UnityEngine; + +public interface IPlayer +{ + bool isDead { get; } +} diff --git a/Assets/Scripts/PlayerScript/IPlayer.cs.meta b/Assets/Scripts/PlayerScript/IPlayer.cs.meta new file mode 100644 index 0000000..0d6f7b6 --- /dev/null +++ b/Assets/Scripts/PlayerScript/IPlayer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9eea067ca01685f4790d3cd0214321ea \ No newline at end of file diff --git a/Assets/Scripts/PlayerScript/Player.cs b/Assets/Scripts/PlayerScript/Player.cs new file mode 100644 index 0000000..8673330 --- /dev/null +++ b/Assets/Scripts/PlayerScript/Player.cs @@ -0,0 +1,34 @@ +using UnityEngine; + +public class Player : MonoBehaviour, IPlayer +{ + public float jumpforce = 4f; + public Rigidbody BallRb; + public bool isDead { get; private set; } + + void Start() + { + if (BallRb == null) + { + BallRb = GetComponent(); + } + } + + void OnCollisionEnter(Collision collision) + { + if (collision.collider.CompareTag("Platform")) + { + BallRb.linearVelocity = new Vector3(0, jumpforce, 0); + } + else if (collision.collider.CompareTag("Death")) + { + Die(); + } + } + + void Die() + { + Debug.Log("Player is Dead"); + isDead = true; + } +} diff --git a/Assets/Scripts/PlayerScript/Player.cs.meta b/Assets/Scripts/PlayerScript/Player.cs.meta new file mode 100644 index 0000000..70e5d7a --- /dev/null +++ b/Assets/Scripts/PlayerScript/Player.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a23214d81cfb862488bd856cfdffb896 \ No newline at end of file diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index d057ba3..2d1b230 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -9,5 +9,6 @@ EditorBuildSettings: path: Assets/Scenes/SampleScene.unity guid: 99c9720ab356a0642a771bea13969a05 m_configObjects: + com.unity.input.settings: {fileID: 11400000, guid: 2d83205f1e741964f944c622640bd1e2, type: 2} com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3} m_UseUCBPForAssetBundles: 0 diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 1c62123..ab38b6d 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -922,7 +922,7 @@ PlayerSettings: qnxGraphicConfPath: apiCompatibilityLevel: 6 captureStartupLogs: {} - activeInputHandler: 2 + activeInputHandler: 1 windowsGamepadBackendHint: 0 cloudProjectId: 54d670be-638d-4e43-b78b-9ddf7653f362 framebufferDepthMemorylessMode: 0 diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index a1643de..7109323 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -5,6 +5,7 @@ TagManager: serializedVersion: 3 tags: - Platform + - Death layers: - Default - TransparentFX