Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/공격 파라미터를 상대방한테 보내지 않는 버그 #286

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 13 additions & 22 deletions Assets/Resources/Animation/Scanvenger.controller
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,7 @@ AnimatorStateTransition:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: Attack
m_EventTreshold: 0
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 8196928900579075133}
m_Solo: 0
Expand Down Expand Up @@ -1390,7 +1387,7 @@ AnimatorStateTransition:
m_ConditionEvent: THW
m_EventTreshold: 0
- m_ConditionMode: 1
m_ConditionEvent: Attack
m_ConditionEvent: AttackTrig
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 4910770242676304587}
Expand Down Expand Up @@ -1465,10 +1462,7 @@ AnimatorStateTransition:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: Attack
m_EventTreshold: 0
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 8196928900579075133}
m_Solo: 0
Expand Down Expand Up @@ -1720,12 +1714,6 @@ AnimatorController:
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
- m_Name: Attack
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
- m_Name: OHW
m_Type: 4
m_DefaultFloat: 0
Expand Down Expand Up @@ -1786,6 +1774,12 @@ AnimatorController:
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
- m_Name: AttackTrig
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
Expand Down Expand Up @@ -2022,7 +2016,7 @@ AnimatorStateTransition:
m_ConditionEvent: THW
m_EventTreshold: 0
- m_ConditionMode: 1
m_ConditionEvent: Attack
m_ConditionEvent: AttackTrig
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 5121244804484420677}
Expand Down Expand Up @@ -2751,7 +2745,7 @@ AnimatorStateTransition:
m_ConditionEvent: THW
m_EventTreshold: 0
- m_ConditionMode: 1
m_ConditionEvent: Attack
m_ConditionEvent: AttackTrig
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -3997231639984790676}
Expand Down Expand Up @@ -3373,7 +3367,7 @@ AnimatorStateMachine:
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: -3441287533508079224}
m_Position: {x: 20, y: 180, z: 0}
m_Position: {x: 10, y: 180, z: 0}
- serializedVersion: 1
m_State: {fileID: 6111829770411307022}
m_Position: {x: 260, y: 180, z: 0}
Expand Down Expand Up @@ -3646,10 +3640,7 @@ AnimatorStateTransition:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: Attack
m_EventTreshold: 0
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 8196928900579075133}
m_Solo: 0
Expand Down
3 changes: 3 additions & 0 deletions Assets/Resources/Prefabs/Player.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -5305,6 +5305,9 @@ MonoBehaviour:
- Type: 9
SynchronizeType: 1
Name: Cancel
- Type: 9
SynchronizeType: 1
Name: AttackTrig
m_SynchronizeLayers:
- SynchronizeType: 1
LayerIndex: 0
Expand Down
8 changes: 6 additions & 2 deletions Assets/Scripts/Player/AttackManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ public void Attack()
{
// 무기를 사용하고 애니메이션을 트리거합니다.
equipWeaponGameobject.Use(); // 무기 사용
movementStateManager.anim.SetBool("Attack", true); // 애니메이션 트리거
pv.RPC("AttackTrig", RpcTarget.All);
fireDelay = 0; // 공격 딜레이 초기화
}
else movementStateManager.anim.SetBool("Attack", false); // 애니메이션 트리거
}

[PunRPC]
void AttackTrig(){
movementStateManager.anim.SetTrigger("AttackTrig");
}

// 공격 시작
Expand Down
2 changes: 2 additions & 0 deletions Assets/Scripts/Player/WeaponManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public void callAttack(){
if(swingCoroutine != null)
{
StopCoroutine(swingCoroutine);
swingCoroutine = null;
}
if(type == Type.Melee)
{
Expand Down Expand Up @@ -87,6 +88,7 @@ IEnumerator Swing(){
}
yield return new WaitForSeconds(rate - colliderOn - colliderOff);
chk = true; // 코루틴 종료 후 변수 초기화
swingCoroutine = null;
attackManager.AttackOut();
}
}