From 36da5ec8482c84e90f30dfdb9262f0a0adf4d222 Mon Sep 17 00:00:00 2001 From: Evan Nydahl Date: Fri, 3 Dec 2021 13:55:32 -0600 Subject: [PATCH] Resolved many merge conflicts --- Assets/Scripts/KingAbilities/Boulder.cs | 2 +- Assets/Scripts/KingAbilities/Bumper.cs | 2 +- Assets/Scripts/KingAbilities/Hail.cs | 2 +- .../DebugPlayer/dPlayerMovement.cs | 2 +- .../PlayerScripts/MovementAbilities/Nitro.cs | 38 ----- .../ItemScripts/GamePadControlls.cs | 132 ------------------ .../ItemScripts/GamePadControlls.cs.meta | 11 -- .../ItemScripts/GamePadControlls.inputactions | 33 ----- .../GamePadControlls.inputactions.meta | 14 -- .../PlayerItems/ItemScripts/Nitro.cs | 37 ++--- UserSettings/EditorUserSettings.asset | 10 +- 11 files changed, 28 insertions(+), 255 deletions(-) delete mode 100644 Assets/Scripts/PlayerScripts/MovementAbilities/Nitro.cs delete mode 100644 Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.cs delete mode 100644 Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.cs.meta delete mode 100644 Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.inputactions delete mode 100644 Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.inputactions.meta diff --git a/Assets/Scripts/KingAbilities/Boulder.cs b/Assets/Scripts/KingAbilities/Boulder.cs index 0540903..dd1545d 100644 --- a/Assets/Scripts/KingAbilities/Boulder.cs +++ b/Assets/Scripts/KingAbilities/Boulder.cs @@ -17,7 +17,7 @@ public class Boulder : MonoBehaviour Vector3 Dir = boulder.velocity;//Finds the bolder's velocity float Power = boulder.velocity.magnitude * 250;//Finds the power of the boulder by using it's velocity and a scaler Dir = Vector3.Normalize(Dir);//Normalizes the vector to be used as a knockback direction - player.GetComponent().getHit(Dir, Power); //Ragdolls the player in the direction of the bolder depending on it's speed + player.GetComponent().GetHit(Dir, Power); //Ragdolls the player in the direction of the bolder depending on it's speed } } diff --git a/Assets/Scripts/KingAbilities/Bumper.cs b/Assets/Scripts/KingAbilities/Bumper.cs index b60c5e0..4e7002e 100644 --- a/Assets/Scripts/KingAbilities/Bumper.cs +++ b/Assets/Scripts/KingAbilities/Bumper.cs @@ -12,7 +12,7 @@ public class Bumper : MonoBehaviour { float DirBumpZ = other.GetComponent().vel.z * -1;//Inverts the Player Velocity y Vector3 DirBump = new Vector3(DirBumpX, .01f, DirBumpZ);//Creates a direction to launch the player DirBump = Vector3.Normalize(DirBump);//Normalizes the vector to be used as a bump direction - other.GetComponent().getHit(DirBump, 50); //Launches tthe player directly away from the bumper + other.GetComponent().GetHit(DirBump, 50); //Launches tthe player directly away from the bumper } } } diff --git a/Assets/Scripts/KingAbilities/Hail.cs b/Assets/Scripts/KingAbilities/Hail.cs index ff043b8..eb955d2 100644 --- a/Assets/Scripts/KingAbilities/Hail.cs +++ b/Assets/Scripts/KingAbilities/Hail.cs @@ -38,7 +38,7 @@ public class Hail : MonoBehaviour float hz = hail.transform.position.z; //Direction pointing away from the center of the Hail Vector3 Dir = new Vector3(px - hx, 0, pz - hz); - player.GetComponent().getHit(Dir, Power); //Ragdolls the player in the direction of the bolder depending on it's speed + player.GetComponent().GetHit(Dir, Power); //Ragdolls the player in the direction of the bolder depending on it's speed } } diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs index d5837ff..355cc27 100644 --- a/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs @@ -409,7 +409,7 @@ public class dPlayerMovement : NetworkBehaviour } //Ragdoll Functions - private void GetHit(Vector3 dir, float force){ + public void GetHit(Vector3 dir, float force){ if(firstHit == false){ EnableRagdoll(); dir.Normalize(); diff --git a/Assets/Scripts/PlayerScripts/MovementAbilities/Nitro.cs b/Assets/Scripts/PlayerScripts/MovementAbilities/Nitro.cs deleted file mode 100644 index 98ef4a8..0000000 --- a/Assets/Scripts/PlayerScripts/MovementAbilities/Nitro.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class Nitro : MonoBehaviour -{ - private PlayerStats playerStats; - private CoolDown driver; - private bool isOnCoolDown = false; - public SpecialItem nitroItem; - //this will need to be set from scritable object or something; - private float coolDown; - - // Start is called before the first frame update - void Start(){ - playerStats = GetComponent(); - coolDown = 5.0f; - //retrieves - driver = FindObjectOfType(); - } - - // Update is called once per frame - void Update(){ - //once cooldowns are implemented, put this on one (a long one) - if (Input.GetKeyDown(KeyCode.LeftShift) && isOnCoolDown == false){ - playerStats.CurVel = playerStats.MaxVel; - StartCoroutine(startCoolDown()); - } - } - private IEnumerator startCoolDown(){ - Debug.Log("start corotine"); - isOnCoolDown = true; - //driver.startUICooldown("Nitro"); - yield return new WaitForSeconds(nitroItem.cooldownM); - isOnCoolDown = false; - Debug.Log("end corotine"); - } -} diff --git a/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.cs b/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.cs deleted file mode 100644 index 77ce83a..0000000 --- a/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.cs +++ /dev/null @@ -1,132 +0,0 @@ -// GENERATED AUTOMATICALLY FROM 'Assets/Scripts/PlayerScripts/MovementAbilities/GamePadControlls.inputactions' - -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine.InputSystem; -using UnityEngine.InputSystem.Utilities; - -public class @GamePadControlls : IInputActionCollection, IDisposable -{ - public InputActionAsset asset { get; } - public @GamePadControlls() - { - asset = InputActionAsset.FromJson(@"{ - ""name"": ""GamePadControlls"", - ""maps"": [ - { - ""name"": ""Runner"", - ""id"": ""5b72a223-d8e7-4904-bda9-b7bc5bf92850"", - ""actions"": [ - { - ""name"": ""Jump"", - ""type"": ""Button"", - ""id"": ""bd111e05-cd62-4634-ac88-eb948971f528"", - ""expectedControlType"": ""Button"", - ""processors"": """", - ""interactions"": """" - } - ], - ""bindings"": [ - { - ""name"": """", - ""id"": ""9fde690f-bb27-4b3c-a7e4-4354283ff9da"", - ""path"": ""/buttonSouth"", - ""interactions"": """", - ""processors"": """", - ""groups"": """", - ""action"": ""Jump"", - ""isComposite"": false, - ""isPartOfComposite"": false - } - ] - } - ], - ""controlSchemes"": [] -}"); - // Runner - m_Runner = asset.FindActionMap("Runner", throwIfNotFound: true); - m_Runner_Jump = m_Runner.FindAction("Jump", throwIfNotFound: true); - } - - 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(); - } - - // Runner - private readonly InputActionMap m_Runner; - private IRunnerActions m_RunnerActionsCallbackInterface; - private readonly InputAction m_Runner_Jump; - public struct RunnerActions - { - private @GamePadControlls m_Wrapper; - public RunnerActions(@GamePadControlls wrapper) { m_Wrapper = wrapper; } - public InputAction @Jump => m_Wrapper.m_Runner_Jump; - public InputActionMap Get() { return m_Wrapper.m_Runner; } - public void Enable() { Get().Enable(); } - public void Disable() { Get().Disable(); } - public bool enabled => Get().enabled; - public static implicit operator InputActionMap(RunnerActions set) { return set.Get(); } - public void SetCallbacks(IRunnerActions instance) - { - if (m_Wrapper.m_RunnerActionsCallbackInterface != null) - { - @Jump.started -= m_Wrapper.m_RunnerActionsCallbackInterface.OnJump; - @Jump.performed -= m_Wrapper.m_RunnerActionsCallbackInterface.OnJump; - @Jump.canceled -= m_Wrapper.m_RunnerActionsCallbackInterface.OnJump; - } - m_Wrapper.m_RunnerActionsCallbackInterface = instance; - if (instance != null) - { - @Jump.started += instance.OnJump; - @Jump.performed += instance.OnJump; - @Jump.canceled += instance.OnJump; - } - } - } - public RunnerActions @Runner => new RunnerActions(this); - public interface IRunnerActions - { - void OnJump(InputAction.CallbackContext context); - } -} diff --git a/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.cs.meta b/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.cs.meta deleted file mode 100644 index 723882b..0000000 --- a/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3698cf5288c74ad41ba892329e2fb719 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.inputactions b/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.inputactions deleted file mode 100644 index eb95162..0000000 --- a/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.inputactions +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "GamePadControlls", - "maps": [ - { - "name": "Runner", - "id": "5b72a223-d8e7-4904-bda9-b7bc5bf92850", - "actions": [ - { - "name": "Jump", - "type": "Button", - "id": "bd111e05-cd62-4634-ac88-eb948971f528", - "expectedControlType": "Button", - "processors": "", - "interactions": "" - } - ], - "bindings": [ - { - "name": "", - "id": "9fde690f-bb27-4b3c-a7e4-4354283ff9da", - "path": "/buttonSouth", - "interactions": "", - "processors": "", - "groups": "", - "action": "Jump", - "isComposite": false, - "isPartOfComposite": false - } - ] - } - ], - "controlSchemes": [] -} \ No newline at end of file diff --git a/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.inputactions.meta b/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.inputactions.meta deleted file mode 100644 index e2844b9..0000000 --- a/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/GamePadControlls.inputactions.meta +++ /dev/null @@ -1,14 +0,0 @@ -fileFormatVersion: 2 -guid: c3d6a5f3edd2f9d4693efbb2085dde9c -ScriptedImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3} - generateWrapperCode: 1 - wrapperCodePath: - wrapperClassName: - wrapperCodeNamespace: diff --git a/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/Nitro.cs b/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/Nitro.cs index e89c2c4..52c6866 100644 --- a/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/Nitro.cs +++ b/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/Nitro.cs @@ -11,26 +11,27 @@ public class Nitro : MonoBehaviour private float coolDown; // Start is called before the first frame update - void Start(){ + void Start() + { playerStats = GetComponent(); - coolDown = 5.0f; - //retrieves - driver = FindObjectOfType(); } - //// Update is called once per frame - //void Update(){ - // //once cooldowns are implemented, put this on one (a long one) - // if (Input.GetKeyDown(KeyCode.LeftShift) && isOnCoolDown == false){ - // playerStats.CurVel = playerStats.MaxVel; - // StartCoroutine(startCoolDown()); - // } - //} - //private IEnumerator startCoolDown(){ - // Debug.Log("start corotine"); - // isOnCoolDown = true; + // Update is called once per frame + void Update() + { + //once cooldowns are implemented, put this on one (a long one) + if (Input.GetKeyDown(KeyCode.LeftShift) && isOnCoolDown == false) + { + playerStats.CurVel = playerStats.MaxVel; + StartCoroutine(startCoolDown()); + } + } + + private IEnumerator startCoolDown(){ + Debug.Log("start corotine"); + isOnCoolDown = true; // driver.startUICooldown("Nitro"); - // yield return new WaitForSeconds(coolDown); - // isOnCoolDown = false; - //} + yield return new WaitForSeconds(coolDown); + isOnCoolDown = false; + } } diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index 0d3b8f2..f476c18 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -15,14 +15,14 @@ EditorUserSettings: value: 22424703114646680e0b0227036c7b151b180b650d262f3d192c0e27d1e33136e7a923e7ee2e26 flags: 0 RecentlyUsedScenePath-3: - value: 22424703114646680e0b0227036c78111b125507233d28242c20137df7ee3d2cfb - flags: 0 - RecentlyUsedScenePath-4: value: 22424703114646680e0b0227036c7b151b180b6501273035202c1327d1e33136e7a923e7ee2e26 flags: 0 - RecentlyUsedScenePath-5: + RecentlyUsedScenePath-4: value: 22424703114646680e0b0227036c7b151b180b6519016b0515163936efef2776f7e93ffdfe flags: 0 + RecentlyUsedScenePath-5: + value: 22424703114646680e0b0227036c731f1415016439262f2434 + flags: 0 RecentlyUsedScenePath-6: value: 22424703114646680e0b0227036c731f1415016439262f2434 flags: 0 @@ -30,7 +30,7 @@ EditorUserSettings: value: 22424703114646680e0b0227036c78111b125507233d28242c20137df7ee3d2cfb flags: 0 RecentlyUsedScenePath-8: - value: 22424703114646680e0b0227036c731f1415016439262f2434 + value: 22424703114646680e0b0227036c7b151b180b652b3a27292f260573f1e33136e7a923e7ee2e26 flags: 0 RecentlyUsedScenePath-9: value: 22424703114646680e0b0227036c7b151b180b652b3a27292f260573f1e33136e7a923e7ee2e26