Walking speed correction and sword/pickaxe attack handling

This commit is contained in:
Jakub Sztuba 2022-10-11 01:44:52 +07:00
parent eef1697737
commit 5d89daef4a
5 changed files with 17 additions and 16 deletions

View File

@ -76,12 +76,10 @@ AnimationClip:
- curve: - curve:
- time: 0 - time: 0
value: {fileID: 5523046169430618816, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3} value: {fileID: 5523046169430618816, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3}
- time: 0.083333336
value: {fileID: 2641884549179919215, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3}
- time: 0.16666667 - time: 0.16666667
value: {fileID: -5084081418433795573, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3}
- time: 0.25
value: {fileID: 2641884549179919215, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3} value: {fileID: 2641884549179919215, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3}
- time: 0.33333334
value: {fileID: -5084081418433795573, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3}
attribute: m_Sprite attribute: m_Sprite
path: path:
classID: 212 classID: 212
@ -111,13 +109,12 @@ AnimationClip:
- {fileID: 5523046169430618816, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3} - {fileID: 5523046169430618816, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3}
- {fileID: 2641884549179919215, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3} - {fileID: 2641884549179919215, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3}
- {fileID: -5084081418433795573, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3} - {fileID: -5084081418433795573, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3}
- {fileID: 2641884549179919215, guid: 0c933d03180a3284590a9b1be2aa123d, type: 3}
m_AnimationClipSettings: m_AnimationClipSettings:
serializedVersion: 2 serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0 m_AdditiveReferencePoseTime: 0
m_StartTime: 0 m_StartTime: 0
m_StopTime: 0.33333334 m_StopTime: 0.4166667
m_OrientationOffsetY: 0 m_OrientationOffsetY: 0
m_Level: 0 m_Level: 0
m_CycleOffset: 0 m_CycleOffset: 0

View File

@ -113,7 +113,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 840a82f054869244b832426e6b6022bd, type: 3} m_Script: {fileID: 11500000, guid: 840a82f054869244b832426e6b6022bd, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
walkSpeed: 5.5 walkSpeed: 4
Panel: {fileID: 0} Panel: {fileID: 0}
dmgParticleSystem: {fileID: 4869648843387222763} dmgParticleSystem: {fileID: 4869648843387222763}
maxHealth: {fileID: 11400000, guid: 2cac7af95874b184aae736e0ed4994d7, type: 2} maxHealth: {fileID: 11400000, guid: 2cac7af95874b184aae736e0ed4994d7, type: 2}

View File

@ -44,6 +44,8 @@ public class ChestController : BaseWarehouseController
} }
} }
} }
void OnTriggerExit2D(Collider2D collision) void OnTriggerExit2D(Collider2D collision)

View File

@ -62,4 +62,5 @@ public class EquipmentPanelController : BasePanelController
return tmp; return tmp;
} }
} }

View File

@ -92,18 +92,19 @@ public class Player : MonoBehaviour
private void HandleAttacks() private void HandleAttacks()
{ {
if (attackSword) if (EquipmentManager.Instance._weapon.Name.Equals("pickaxe_test") && attackSword)
{
myAnimator.SetTrigger("attack");
}
if (attackFist)
{
myAnimator.SetTrigger("attackFist");
}
if (pickaxeInUse)
{ {
myAnimator.SetTrigger("pickaxe"); 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() private void HandleInput()