From 5d89daef4a6cce87370f3935920c96b2973cc97a Mon Sep 17 00:00:00 2001 From: Jakub Sztuba Date: Tue, 11 Oct 2022 01:44:52 +0700 Subject: [PATCH] Walking speed correction and sword/pickaxe attack handling --- Assets/Animations/MainCharacter/WalkDown.anim | 9 +++------ Assets/Resources/ThePlayer.prefab | 2 +- Assets/Scripts/Chest/ChestController.cs | 2 ++ .../Equipment/EquipmentPanelController.cs | 1 + Assets/Scripts/Player.cs | 19 ++++++++++--------- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Assets/Animations/MainCharacter/WalkDown.anim b/Assets/Animations/MainCharacter/WalkDown.anim index 2c3e23ec..a76c6763 100644 --- a/Assets/Animations/MainCharacter/WalkDown.anim +++ b/Assets/Animations/MainCharacter/WalkDown.anim @@ -76,12 +76,10 @@ AnimationClip: - curve: - time: 0 value: {fileID: 5523046169430618816, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3} - - time: 0.083333336 - value: {fileID: 2641884549179919215, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3} - time: 0.16666667 - value: {fileID: -5084081418433795573, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3} - - time: 0.25 value: {fileID: 2641884549179919215, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3} + - time: 0.33333334 + value: {fileID: -5084081418433795573, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3} attribute: m_Sprite path: classID: 212 @@ -111,13 +109,12 @@ AnimationClip: - {fileID: 5523046169430618816, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3} - {fileID: 2641884549179919215, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3} - {fileID: -5084081418433795573, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3} - - {fileID: 2641884549179919215, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3} m_AnimationClipSettings: serializedVersion: 2 m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseTime: 0 m_StartTime: 0 - m_StopTime: 0.33333334 + m_StopTime: 0.4166667 m_OrientationOffsetY: 0 m_Level: 0 m_CycleOffset: 0 diff --git a/Assets/Resources/ThePlayer.prefab b/Assets/Resources/ThePlayer.prefab index 9507b5e7..43e13a99 100644 --- a/Assets/Resources/ThePlayer.prefab +++ b/Assets/Resources/ThePlayer.prefab @@ -113,7 +113,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 840a82f054869244b832426e6b6022bd, type: 3} m_Name: m_EditorClassIdentifier: - walkSpeed: 5.5 + walkSpeed: 4 Panel: {fileID: 0} dmgParticleSystem: {fileID: 4869648843387222763} maxHealth: {fileID: 11400000, guid: 2cac7af95874b184aae736e0ed4994d7, type: 2} diff --git a/Assets/Scripts/Chest/ChestController.cs b/Assets/Scripts/Chest/ChestController.cs index ad4277d5..d693623b 100644 --- a/Assets/Scripts/Chest/ChestController.cs +++ b/Assets/Scripts/Chest/ChestController.cs @@ -43,6 +43,8 @@ public class ChestController : BaseWarehouseController EquipmentManager.Instance.OpenPanel(); } } + + } diff --git a/Assets/Scripts/Equipment/EquipmentPanelController.cs b/Assets/Scripts/Equipment/EquipmentPanelController.cs index 30bee5ed..ffb80b56 100644 --- a/Assets/Scripts/Equipment/EquipmentPanelController.cs +++ b/Assets/Scripts/Equipment/EquipmentPanelController.cs @@ -62,4 +62,5 @@ public class EquipmentPanelController : BasePanelController return tmp; } + } diff --git a/Assets/Scripts/Player.cs b/Assets/Scripts/Player.cs index 6dce2ad3..d8ff1248 100644 --- a/Assets/Scripts/Player.cs +++ b/Assets/Scripts/Player.cs @@ -92,18 +92,19 @@ public class Player : MonoBehaviour private void HandleAttacks() { - if (attackSword) - { - myAnimator.SetTrigger("attack"); - } - if (attackFist) - { - myAnimator.SetTrigger("attackFist"); - } - if (pickaxeInUse) + if (EquipmentManager.Instance._weapon.Name.Equals("pickaxe_test") && attackSword) { myAnimator.SetTrigger("pickaxe"); } + else if (attackSword && EquipmentManager.Instance._weapon.Name.Equals("Basic_Sword")) + { + myAnimator.SetTrigger("attack"); + } + else if (attackFist) + { + myAnimator.SetTrigger("attackFist"); + } + } private void HandleInput()