summaryrefslogtreecommitdiff
path: root/GameCode/PlayerDoBlock.cs
diff options
context:
space:
mode:
Diffstat (limited to 'GameCode/PlayerDoBlock.cs')
-rw-r--r--GameCode/PlayerDoBlock.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/GameCode/PlayerDoBlock.cs b/GameCode/PlayerDoBlock.cs
new file mode 100644
index 0000000..5f14851
--- /dev/null
+++ b/GameCode/PlayerDoBlock.cs
@@ -0,0 +1,23 @@
+using Photon.Pun;
+using UnityEngine;
+
+public class PlayerDoBlock : MonoBehaviour
+{
+ private CharacterData data;
+
+ private SyncPlayerMovement sync;
+
+ private void Start()
+ {
+ data = GetComponentInParent<CharacterData>();
+ sync = GetComponentInParent<SyncPlayerMovement>();
+ }
+
+ public void DoBlock()
+ {
+ if (data.view.IsMine)
+ {
+ sync.SendBlock(BlockTrigger.BlockTriggerType.Default, firstBlock: true, dontSetCD: true);
+ }
+ }
+}