Removed TOTU 103
This commit is contained in:
		
							
								
								
									
										48
									
								
								Assets/Rendering/Scripts/Input/AnimationsUI.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								Assets/Rendering/Scripts/Input/AnimationsUI.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,48 @@ | ||||
| using UnityEngine; | ||||
|  | ||||
| public class AnimationsUI : MonoBehaviour | ||||
| { | ||||
|     [SerializeField] private GameObject extraMenu; | ||||
|     private bool isMenuActive = false; | ||||
|  | ||||
|     void Start() | ||||
|     { | ||||
|         // Asegurarse de que el men<65> est<73> en la posici<63>n fuera de la pantalla al inicio | ||||
|         extraMenu.GetComponent<RectTransform>().anchoredPosition = new Vector2(extraMenu.GetComponent<RectTransform>().anchoredPosition.x, 550); | ||||
|         extraMenu.SetActive(false); // El men<65> empieza desactivado | ||||
|     } | ||||
|  | ||||
|     public void ToggleExtraMenu() | ||||
|     { | ||||
|         if (isMenuActive) | ||||
|         { | ||||
|             DeactivateExtraMenu(); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             ActivateExtraMenu(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void ActivateExtraMenu() | ||||
|     { | ||||
|         // Colocar el men<65> en la posici<63>n fuera de la vista antes de activarlo | ||||
|         extraMenu.GetComponent<RectTransform>().anchoredPosition = new Vector2(extraMenu.GetComponent<RectTransform>().anchoredPosition.x, 550); | ||||
|         extraMenu.SetActive(true);  // Activar el men<65> inmediatamente | ||||
|         LeanTween.moveY(extraMenu.GetComponent<RectTransform>(), -400, 0.5f) // Reducir tiempo de animaci<63>n | ||||
|                  .setEase(LeanTweenType.easeOutExpo) | ||||
|                  .setOnComplete(() => isMenuActive = true);  // Cambiar el estado del men<65> | ||||
|     } | ||||
|  | ||||
|     public void DeactivateExtraMenu() | ||||
|     { | ||||
|         // Animar el men<65> para ocultarlo y desactivarlo al terminar la animaci<63>n | ||||
|         LeanTween.moveY(extraMenu.GetComponent<RectTransform>(), 550, 0.5f) // Reducir tiempo de animaci<63>n | ||||
|                  .setEase(LeanTweenType.easeInExpo) | ||||
|                  .setOnComplete(() => | ||||
|                  { | ||||
|                      extraMenu.SetActive(false);  // Desactivar el men<65> despu<70>s de la animaci<63>n | ||||
|                      isMenuActive = false;  // Cambiar el estado del men<65> | ||||
|                  }); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/Rendering/Scripts/Input/AnimationsUI.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/Rendering/Scripts/Input/AnimationsUI.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: d34713073cfff8e449751aa3cdb33704 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										31
									
								
								Assets/Rendering/Scripts/Input/InputHandler.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								Assets/Rendering/Scripts/Input/InputHandler.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | ||||
| using System; | ||||
| using UnityEngine; | ||||
| using UnityEngine.InputSystem; | ||||
|  | ||||
| public class InputHandler : MonoBehaviour | ||||
| { | ||||
|     public static event Action OnTap; | ||||
|     private UserInput _userInput; | ||||
|  | ||||
|     private void Awake() | ||||
|     { | ||||
|         _userInput = new UserInput(); | ||||
|         _userInput.Enable(); | ||||
|  | ||||
|     } | ||||
|  | ||||
|     private void Start() | ||||
|     { | ||||
|         _userInput.MobileTouch.Tap.performed += OnTapPerformed; | ||||
|     } | ||||
|  | ||||
|     private void OnTapPerformed(InputAction.CallbackContext context) | ||||
|     { | ||||
|         OnTap?.Invoke(); | ||||
|     } | ||||
|  | ||||
|     private void OnDestroy() | ||||
|     { | ||||
|         _userInput.MobileTouch.Tap.performed -= OnTapPerformed; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/Rendering/Scripts/Input/InputHandler.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/Rendering/Scripts/Input/InputHandler.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 1e43702aefc12384a940b0cc2439dcb3 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										183
									
								
								Assets/Rendering/Scripts/Input/UserInput.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										183
									
								
								Assets/Rendering/Scripts/Input/UserInput.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,183 @@ | ||||
| //------------------------------------------------------------------------------ | ||||
| // <auto-generated> | ||||
| //     This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator | ||||
| //     version 1.11.0 | ||||
| //     from Assets/Rendering/Scripts/Input/UserInput.inputactions | ||||
| // | ||||
| //     Changes to this file may cause incorrect behavior and will be lost if | ||||
| //     the code is regenerated. | ||||
| // </auto-generated> | ||||
| //------------------------------------------------------------------------------ | ||||
|  | ||||
| using System; | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine.InputSystem; | ||||
| using UnityEngine.InputSystem.Utilities; | ||||
|  | ||||
| public partial class @UserInput: IInputActionCollection2, IDisposable | ||||
| { | ||||
|     public InputActionAsset asset { get; } | ||||
|     public @UserInput() | ||||
|     { | ||||
|         asset = InputActionAsset.FromJson(@"{ | ||||
|     ""name"": ""UserInput"", | ||||
|     ""maps"": [ | ||||
|         { | ||||
|             ""name"": ""MobileTouch"", | ||||
|             ""id"": ""61b9d527-e568-4d9a-b29c-76c81e318c30"", | ||||
|             ""actions"": [ | ||||
|                 { | ||||
|                     ""name"": ""Tap"", | ||||
|                     ""type"": ""Button"", | ||||
|                     ""id"": ""cc2f4409-7610-4448-8159-a64fcf617dcc"", | ||||
|                     ""expectedControlType"": """", | ||||
|                     ""processors"": """", | ||||
|                     ""interactions"": """", | ||||
|                     ""initialStateCheck"": false | ||||
|                 } | ||||
|             ], | ||||
|             ""bindings"": [ | ||||
|                 { | ||||
|                     ""name"": """", | ||||
|                     ""id"": ""77adbad9-9a21-48ad-b3ed-9c05bb6b8080"", | ||||
|                     ""path"": ""<Touchscreen>/primaryTouch/tap"", | ||||
|                     ""interactions"": ""Tap"", | ||||
|                     ""processors"": """", | ||||
|                     ""groups"": """", | ||||
|                     ""action"": ""Tap"", | ||||
|                     ""isComposite"": false, | ||||
|                     ""isPartOfComposite"": false | ||||
|                 }, | ||||
|                 { | ||||
|                     ""name"": """", | ||||
|                     ""id"": ""d2bc1807-065d-4e50-bb15-4c59d514aee2"", | ||||
|                     ""path"": ""<Mouse>/leftButton"", | ||||
|                     ""interactions"": ""Tap"", | ||||
|                     ""processors"": """", | ||||
|                     ""groups"": """", | ||||
|                     ""action"": ""Tap"", | ||||
|                     ""isComposite"": false, | ||||
|                     ""isPartOfComposite"": false | ||||
|                 } | ||||
|             ] | ||||
|         } | ||||
|     ], | ||||
|     ""controlSchemes"": [] | ||||
| }"); | ||||
|         // MobileTouch | ||||
|         m_MobileTouch = asset.FindActionMap("MobileTouch", throwIfNotFound: true); | ||||
|         m_MobileTouch_Tap = m_MobileTouch.FindAction("Tap", throwIfNotFound: true); | ||||
|     } | ||||
|  | ||||
|     ~@UserInput() | ||||
|     { | ||||
|         UnityEngine.Debug.Assert(!m_MobileTouch.enabled, "This will cause a leak and performance issues, UserInput.MobileTouch.Disable() has not been called."); | ||||
|     } | ||||
|  | ||||
|     public void Dispose() | ||||
|     { | ||||
|         UnityEngine.Object.Destroy(asset); | ||||
|     } | ||||
|  | ||||
|     public InputBinding? bindingMask | ||||
|     { | ||||
|         get => asset.bindingMask; | ||||
|         set => asset.bindingMask = value; | ||||
|     } | ||||
|  | ||||
|     public ReadOnlyArray<InputDevice>? devices | ||||
|     { | ||||
|         get => asset.devices; | ||||
|         set => asset.devices = value; | ||||
|     } | ||||
|  | ||||
|     public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes; | ||||
|  | ||||
|     public bool Contains(InputAction action) | ||||
|     { | ||||
|         return asset.Contains(action); | ||||
|     } | ||||
|  | ||||
|     public IEnumerator<InputAction> GetEnumerator() | ||||
|     { | ||||
|         return asset.GetEnumerator(); | ||||
|     } | ||||
|  | ||||
|     IEnumerator IEnumerable.GetEnumerator() | ||||
|     { | ||||
|         return GetEnumerator(); | ||||
|     } | ||||
|  | ||||
|     public void Enable() | ||||
|     { | ||||
|         asset.Enable(); | ||||
|     } | ||||
|  | ||||
|     public void Disable() | ||||
|     { | ||||
|         asset.Disable(); | ||||
|     } | ||||
|  | ||||
|     public IEnumerable<InputBinding> bindings => asset.bindings; | ||||
|  | ||||
|     public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false) | ||||
|     { | ||||
|         return asset.FindAction(actionNameOrId, throwIfNotFound); | ||||
|     } | ||||
|  | ||||
|     public int FindBinding(InputBinding bindingMask, out InputAction action) | ||||
|     { | ||||
|         return asset.FindBinding(bindingMask, out action); | ||||
|     } | ||||
|  | ||||
|     // MobileTouch | ||||
|     private readonly InputActionMap m_MobileTouch; | ||||
|     private List<IMobileTouchActions> m_MobileTouchActionsCallbackInterfaces = new List<IMobileTouchActions>(); | ||||
|     private readonly InputAction m_MobileTouch_Tap; | ||||
|     public struct MobileTouchActions | ||||
|     { | ||||
|         private @UserInput m_Wrapper; | ||||
|         public MobileTouchActions(@UserInput wrapper) { m_Wrapper = wrapper; } | ||||
|         public InputAction @Tap => m_Wrapper.m_MobileTouch_Tap; | ||||
|         public InputActionMap Get() { return m_Wrapper.m_MobileTouch; } | ||||
|         public void Enable() { Get().Enable(); } | ||||
|         public void Disable() { Get().Disable(); } | ||||
|         public bool enabled => Get().enabled; | ||||
|         public static implicit operator InputActionMap(MobileTouchActions set) { return set.Get(); } | ||||
|         public void AddCallbacks(IMobileTouchActions instance) | ||||
|         { | ||||
|             if (instance == null || m_Wrapper.m_MobileTouchActionsCallbackInterfaces.Contains(instance)) return; | ||||
|             m_Wrapper.m_MobileTouchActionsCallbackInterfaces.Add(instance); | ||||
|             @Tap.started += instance.OnTap; | ||||
|             @Tap.performed += instance.OnTap; | ||||
|             @Tap.canceled += instance.OnTap; | ||||
|         } | ||||
|  | ||||
|         private void UnregisterCallbacks(IMobileTouchActions instance) | ||||
|         { | ||||
|             @Tap.started -= instance.OnTap; | ||||
|             @Tap.performed -= instance.OnTap; | ||||
|             @Tap.canceled -= instance.OnTap; | ||||
|         } | ||||
|  | ||||
|         public void RemoveCallbacks(IMobileTouchActions instance) | ||||
|         { | ||||
|             if (m_Wrapper.m_MobileTouchActionsCallbackInterfaces.Remove(instance)) | ||||
|                 UnregisterCallbacks(instance); | ||||
|         } | ||||
|  | ||||
|         public void SetCallbacks(IMobileTouchActions instance) | ||||
|         { | ||||
|             foreach (var item in m_Wrapper.m_MobileTouchActionsCallbackInterfaces) | ||||
|                 UnregisterCallbacks(item); | ||||
|             m_Wrapper.m_MobileTouchActionsCallbackInterfaces.Clear(); | ||||
|             AddCallbacks(instance); | ||||
|         } | ||||
|     } | ||||
|     public MobileTouchActions @MobileTouch => new MobileTouchActions(this); | ||||
|     public interface IMobileTouchActions | ||||
|     { | ||||
|         void OnTap(InputAction.CallbackContext context); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/Rendering/Scripts/Input/UserInput.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/Rendering/Scripts/Input/UserInput.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 6fdf824f953584842baff9a570fcfea8 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										45
									
								
								Assets/Rendering/Scripts/Input/UserInput.inputactions
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								Assets/Rendering/Scripts/Input/UserInput.inputactions
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,45 @@ | ||||
| { | ||||
|     "name": "UserInput", | ||||
|     "maps": [ | ||||
|         { | ||||
|             "name": "MobileTouch", | ||||
|             "id": "61b9d527-e568-4d9a-b29c-76c81e318c30", | ||||
|             "actions": [ | ||||
|                 { | ||||
|                     "name": "Tap", | ||||
|                     "type": "Button", | ||||
|                     "id": "cc2f4409-7610-4448-8159-a64fcf617dcc", | ||||
|                     "expectedControlType": "", | ||||
|                     "processors": "", | ||||
|                     "interactions": "", | ||||
|                     "initialStateCheck": false | ||||
|                 } | ||||
|             ], | ||||
|             "bindings": [ | ||||
|                 { | ||||
|                     "name": "", | ||||
|                     "id": "77adbad9-9a21-48ad-b3ed-9c05bb6b8080", | ||||
|                     "path": "<Touchscreen>/primaryTouch/tap", | ||||
|                     "interactions": "Tap", | ||||
|                     "processors": "", | ||||
|                     "groups": "", | ||||
|                     "action": "Tap", | ||||
|                     "isComposite": false, | ||||
|                     "isPartOfComposite": false | ||||
|                 }, | ||||
|                 { | ||||
|                     "name": "", | ||||
|                     "id": "d2bc1807-065d-4e50-bb15-4c59d514aee2", | ||||
|                     "path": "<Mouse>/leftButton", | ||||
|                     "interactions": "Tap", | ||||
|                     "processors": "", | ||||
|                     "groups": "", | ||||
|                     "action": "Tap", | ||||
|                     "isComposite": false, | ||||
|                     "isPartOfComposite": false | ||||
|                 } | ||||
|             ] | ||||
|         } | ||||
|     ], | ||||
|     "controlSchemes": [] | ||||
| } | ||||
							
								
								
									
										14
									
								
								Assets/Rendering/Scripts/Input/UserInput.inputactions.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								Assets/Rendering/Scripts/Input/UserInput.inputactions.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 116a31151feae794ab271c090458bf17 | ||||
| ScriptedImporter: | ||||
|   internalIDToNameTable: [] | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
|   script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3} | ||||
|   generateWrapperCode: 1 | ||||
|   wrapperCodePath:  | ||||
|   wrapperClassName:  | ||||
|   wrapperCodeNamespace:  | ||||
		Reference in New Issue
	
	Block a user
	 Ignacio Gómez Puga
					Ignacio Gómez Puga