11 Commits
main ... Dylan

Author SHA1 Message Date
djkellerman
00e347cc56 Merge branch 'main' into Dylan 2025-04-08 10:20:36 -04:00
RochesterX
70518b2b69 Functioning player movement,
Persistent block needs to be implemented
2025-01-31 12:48:13 -05:00
djkellerman
36815eb876 Block
Added block animation, script, and keybind. Still need to add animation transitions/triggers.
2025-01-31 11:27:03 -05:00
djkellerman
bbaebadbed Merge branch 'main' into Dylan 2025-01-31 10:19:00 -05:00
djkellerman
a32e858f6f Merge branch 'main' into Dylan 2025-01-27 18:40:05 -05:00
djkellerman
1e6872f0fb Update Bones.prefab 2025-01-27 18:39:51 -05:00
djkellerman
390c742d03 Merge branch 'main' into Dylan 2025-01-27 18:23:35 -05:00
djkellerman
62a0b7e4e1 Merge branch 'main' into Dylan 2025-01-27 18:08:49 -05:00
djkellerman
5a379ec239 Merge branch 'main' into Dylan 2025-01-27 17:32:07 -05:00
djkellerman
164df0339c Merge branch 'main' into Dylan 2025-01-20 18:04:37 -05:00
djkellerman
e8b62b8fb7 1/17 2025-01-20 18:01:23 -05:00
5 changed files with 1488 additions and 0 deletions

1405
Assets/Prefabs/Block.anim Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 896bcaa1220cb294480528aa82dbc0e7
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

68
Assets/Scripts/Block.cs Normal file
View File

@@ -0,0 +1,68 @@
using UnityEngine;
using UnityEngine.InputSystem;
[RequireComponent(typeof(PlayerInput))]
[RequireComponent(typeof(Animation))]
public class Block : MonoBehaviour
{
//public bool cancelable = true;
[SerializeField] private BoxCollider2D blockArea;
private InputActionAsset actions;
private Animation animationComponent;
public bool blocking = false;
private void Start()
{
actions = GetComponent<PlayerInput>().actions;
animationComponent = GetComponent<Animation>();
}
private void Update()
{
var blockAction = actions.FindAction("Block");
if (blockAction.ReadValue<float>() == 1f)
{
Debug.Log("Block action triggered!");
//if (!cancelable) return;
//animationComponent.Play("Block");
GetComponent<AnimationPlayer>().Block();
DisableCancellation();
ActivateBlockArea();
}
else
{
DeactivateBlockArea();
}
}
public void ActivateBlockArea()
{
blockArea.enabled = true;
}
public void DeactivateBlockArea()
{
blockArea.enabled = false;
}
public void DisableCancellation()
{
//cancelable = false;
}
public void EnableCancellation()
{
//cancelable = true;
}
public bool IsBlocking()
{
return blockArea.enabled;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: c8c9288561905664eade3f6b2634fc6d

View File

@@ -32,4 +32,9 @@ public class AnimationPlayer : MonoBehaviour
{ {
animator.SetTrigger("punch"); animator.SetTrigger("punch");
} }
public void Block()
{
animator.SetTrigger("Block");
}
} }