diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index 62f0f33..a21b249 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -728,67 +728,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!1001 &820004546 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1294282455099768770, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} - propertyPath: GlobalObjectIdHash - value: 686008210 - objectReference: {fileID: 0} - - target: {fileID: 3120938410244321186, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} - propertyPath: m_Name - value: NetworkedPlayer - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} --- !u!1 &941230147 GameObject: m_ObjectHideFlags: 0 @@ -4826,4 +4765,3 @@ SceneRoots: - {fileID: 1481267923} - {fileID: 65889293} - {fileID: 652688745} - - {fileID: 820004546} diff --git a/Assets/Scripts/Multiplayer/ZDisablerV2.cs b/Assets/Scripts/Multiplayer/ZDisablerV2.cs index c0c9f8c..10b9e0e 100644 --- a/Assets/Scripts/Multiplayer/ZDisablerV2.cs +++ b/Assets/Scripts/Multiplayer/ZDisablerV2.cs @@ -8,7 +8,7 @@ public class ZDisablerV2 : NetworkBehaviour [Tooltip("Add all the objects to disable on join, if not owner")] public UnityEngine.Object[] objectsToDisable; - private void OnEnable() + public override void OnNetworkSpawn() { // Run if networked if (NetworkManager.Singleton == null || IsOwner) return; diff --git a/Assets/Scripts/Player/Input/PlayerInput.cs b/Assets/Scripts/Player/Input/PlayerInput.cs index 1641ec2..e2a9b98 100644 --- a/Assets/Scripts/Player/Input/PlayerInput.cs +++ b/Assets/Scripts/Player/Input/PlayerInput.cs @@ -32,48 +32,12 @@ public class PlayerInput : MonoBehaviour private void Update() { - // check in update to switch if controller is connected/disconnected mid game - controller = Gamepad.all.ElementAtOrDefault(playerNumber); + movement.x = Input.GetAxisRaw("bruh"); + movement.y = Input.GetAxisRaw("bruh_v"); - if (controller != null) - { - movement.x = controller.leftStick.x.ReadValue(); - movement.y = controller.leftStick.y.ReadValue(); + whipAttack = Input.GetKey(KeyCode.R); - look.x = controller.rightStick.x.ReadValue(); - look.y = controller.rightStick.y.ReadValue(); - - whipAttack = controller.buttonWest.IsPressed(); - - if (controller.rightShoulder.IsPressed()) ropeLengthShrinken?.Invoke(playerNumber); - if (controller.leftShoulder.IsPressed()) ropeLengthExtend?.Invoke(playerNumber); - } - else - { - // wasd - if (!useArrowKeys) - { - movement.x = Input.GetAxisRaw("bruh"); - movement.y = Input.GetAxisRaw("bruh_v"); - - whipAttack = Input.GetKey(KeyCode.R); - - if (Input.GetKey(KeyCode.E)) ropeLengthShrinken?.Invoke(playerNumber); - if (Input.GetKey(KeyCode.Q)) ropeLengthExtend?.Invoke(playerNumber); - } - // arrows keys - else - { - movement.x = Input.GetAxisRaw("bruh2"); - movement.y = Input.GetAxisRaw("bruh2_v"); - - whipAttack = Input.GetKey(KeyCode.L); - - if (Input.GetKey(KeyCode.Comma)) ropeLengthShrinken?.Invoke(playerNumber); - if (Input.GetKey(KeyCode.Period)) ropeLengthExtend?.Invoke(playerNumber); - - } - //Debug.Log($"player {playerNumber}: move {movement}"); - } + if (Input.GetKey(KeyCode.E)) ropeLengthShrinken?.Invoke(playerNumber); + if (Input.GetKey(KeyCode.Q)) ropeLengthExtend?.Invoke(playerNumber); } } diff --git a/Assets/Scripts/Rope/RopeSimulator.cs b/Assets/Scripts/Rope/RopeSimulator.cs index 6aac7f3..839c005 100644 --- a/Assets/Scripts/Rope/RopeSimulator.cs +++ b/Assets/Scripts/Rope/RopeSimulator.cs @@ -364,6 +364,7 @@ public class RopeSimulator : MonoBehaviour private void OnDrawGizmos() { + return; if (!Application.isPlaying) return; foreach (var point in rope.points)