Skip to content

Commit

Permalink
Fix Bebek Animation Synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanAMW committed May 22, 2023
1 parent 24a03be commit 64c1cc4
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 38 deletions.
18 changes: 17 additions & 1 deletion Assets/Asset Component/Script/Entities/Bebek/BebekController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,32 @@ private void BebekAnimasi()
{
myAnim.SetBool("isWalk", false);
}
}
}

//[PunRPC]
public void BebekStuner()
{
photonView.RPC("BebekStunerRPC", RpcTarget.All);
}

[PunRPC]
public void BebekStunerRPC()
{
myRb.velocity = Vector2.zero;
myAnim.SetBool("isStun", true);
bebekStats.bebekStun = true;
}

public void SetToNormal()
{
photonView.RPC("SetToNormalRPC", RpcTarget.All);

// bebekStats.bebekStun = false;
// myAnim.SetBool("isStun", false);
}

[PunRPC]
public void SetToNormalRPC()
{
bebekStats.bebekStun = false;
myAnim.SetBool("isStun", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ private IEnumerator BombBebek()

private void OnTriggerStay2D(Collider2D collision)
{
if (!PhotonNetwork.IsMasterClient)
return;

if (collision.CompareTag("Player"))
{
if (!isMbledos)
Expand All @@ -54,9 +51,9 @@ private void OnTriggerStay2D(Collider2D collision)

bebekController = collision.GetComponent<BebekController>();
bebekController.BebekStuner();

//Destroy(gameObject);
//PhotonNetwork.Destroy(gameObject);

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ private IEnumerator BombBebek()

private void OnTriggerStay2D(Collider2D collision)
{
if (!PhotonNetwork.IsMasterClient)
return;

if (collision.CompareTag("Player"))
{
if (!isMbledos)
Expand All @@ -69,9 +66,9 @@ private void OnTriggerStay2D(Collider2D collision)

bebekController = collision.GetComponent<BebekController>();
bebekController.BebekStuner();

//Destroy(gameObject);
//PhotonNetwork.Destroy(gameObject);

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ MonoBehaviour:
- PauseGame
- RPC_SendTimer
- DisplayEggPoint
- PlayBebekStunerAnimation
- SetToNormalRPC
- BebekStunerRPC
DisableAutoOpenWizard: 1
ShowSettings: 0
DevRegionSetOnce: 1
2 changes: 1 addition & 1 deletion Assets/Resources/LocalPlayer.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ MonoBehaviour:
ObservedComponentsFoldoutOpen: 1
Group: 0
prefixField: -1
Synchronization: 3
Synchronization: 2
OwnershipTransfer: 0
observableSearch: 2
ObservedComponents:
Expand Down
4 changes: 2 additions & 2 deletions UserSettings/EditorUserSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ EditorUserSettings:
value: 515250075c0c595e5f5a5e71122159444e4e4a2f7a7d7f602f284d66b4b76661
flags: 0
RecentlyUsedSceneGuid-3:
value: 5106550351530c0f58085c2445775b4442161e2e2a2e7363287a4837b3e2646b
value: 5606575451025d0f5f565d7213735a44404f48792d2c2466287f4567e0b66c3d
flags: 0
RecentlyUsedSceneGuid-4:
value: 5606575451025d0f5f565d7213735a44404f48792d2c2466287f4567e0b66c3d
value: 5106550351530c0f58085c2445775b4442161e2e2a2e7363287a4837b3e2646b
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650
Expand Down
52 changes: 26 additions & 26 deletions UserSettings/Layouts/default-2021.dwlt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 19
controlID: 136
--- !u!114 &6
MonoBehaviour:
m_ObjectHideFlags: 52
Expand All @@ -144,7 +144,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 16192, y: 16192}
vertical: 1
controlID: 50
controlID: 120
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 52
Expand All @@ -169,7 +169,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 51
controlID: 121
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
Expand All @@ -189,8 +189,8 @@ MonoBehaviour:
y: 0
width: 361
height: 585
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 15}
m_Panes:
- {fileID: 15}
Expand All @@ -215,8 +215,8 @@ MonoBehaviour:
y: 0
width: 1103
height: 585
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 16}
m_Panes:
- {fileID: 16}
Expand Down Expand Up @@ -247,7 +247,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 25
controlID: 94
--- !u!114 &11
MonoBehaviour:
m_ObjectHideFlags: 52
Expand Down Expand Up @@ -323,8 +323,8 @@ MonoBehaviour:
y: 0
width: 456
height: 987
m_MinSize: {x: 275, y: 50}
m_MaxSize: {x: 4000, y: 4000}
m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 23}
m_Panes:
- {fileID: 23}
Expand Down Expand Up @@ -389,9 +389,9 @@ MonoBehaviour:
m_SceneHierarchy:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 98770000
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 3e93feff1297feffba97feff409cfeff4e9cfeff6c9cfeff7a9cfeff6e9efeff1e9ffeff26e9feffcce9feff22eafeff2eeafeff42eafeff4eeafeff820affff0c0cffffb00cffff2e11ffff3c11ffff5a11ffff6811ffff4c14ffff9c1effff4e1fffff0c20ffff2c2bffff3638ffffe438ffff1e99ffffe8a4ffff5cc8ffff7ccbffff32ccffff72deffff18dfffff70dfffff7cdfffff90dfffff9cdfffff08fbffff
m_ExpandedIDs: ae8fffff5490ffffa690ffffb290ffffc690ffffd290ffff98b7ffff70bbffff16bcffff66bcffff72bcffff86bcffff92bcffff32cfffffe6e0ffff8ae1ffffdce1ffffe8e1fffffce1ffff08e2ffff1ce7ffff08fbffff
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
Expand Down Expand Up @@ -706,9 +706,9 @@ MonoBehaviour:
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: 1068.6382, y: 450.6527, z: -5.46236}
m_Target: {x: -5.794001, y: 2.6439993, z: 0}
speed: 2
m_Value: {x: 1068.6382, y: 450.6527, z: -5.46236}
m_Value: {x: -5.794001, y: 2.6439993, z: 0}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
Expand Down Expand Up @@ -759,9 +759,9 @@ MonoBehaviour:
speed: 2
m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size:
m_Target: 723.01337
m_Target: 1.0365583
speed: 2
m_Value: 723.01337
m_Value: 1.0365583
m_Ortho:
m_Target: 1
speed: 2
Expand Down Expand Up @@ -839,24 +839,24 @@ MonoBehaviour:
m_LockTracker:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 183}
m_SelectedIDs: 7c770000
m_LastClickedID: 30588
m_ExpandedIDs: 00000000da760000dc760000de760000e0760000e2760000e4760000e6760000e8760000ea7600007e77000000ca9a3b
scrollPos: {x: 0, y: 315}
m_SelectedIDs: ba780000
m_LastClickedID: 30906
m_ExpandedIDs: 000000008478000086780000887800008a7800008c7800008e78000090780000927800009478000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
m_OriginalName:
m_Name: Photon
m_OriginalName: Photon
m_EditFieldRect:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
m_UserData: 0
m_UserData: 30924
m_IsWaitingForDelay: 0
m_IsRenaming: 0
m_OriginalEventType: 11
m_OriginalEventType: 0
m_IsRenamingFilename: 1
m_ClientGUIView: {fileID: 11}
m_SearchString:
Expand All @@ -870,7 +870,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 00000000da760000dc760000de760000e0760000e2760000e4760000e6760000e8760000ea760000
m_ExpandedIDs: 000000008478000086780000887800008a7800008c7800008e780000907800009278000094780000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
Expand Down Expand Up @@ -1099,7 +1099,7 @@ MonoBehaviour:
m_SaveData: []
m_LockTracker:
m_IsLocked: 0
m_LastSelectedObjectID: 53104
m_LastSelectedObjectID: 51528
--- !u!114 &21
MonoBehaviour:
m_ObjectHideFlags: 52
Expand Down

0 comments on commit 64c1cc4

Please sign in to comment.