started adding enemy factory

This commit is contained in:
Mausham
2025-12-31 17:14:20 -08:00
parent 3aabc42bf8
commit 8eafd8bb60
130 changed files with 49524 additions and 46086 deletions

View File

@@ -0,0 +1,33 @@
using Darkmatter.Core;
using UnityEngine;
namespace Darkmatter.Presentation
{
public class EnemyAnimController : HumonoidAnim, IEnemyAnimController
{
private readonly int walkHash = Animator.StringToHash("walk");
private readonly int chaseHash = Animator.StringToHash("chase");
private readonly int attackHash = Animator.StringToHash("attack");
private readonly int deadHash = Animator.StringToHash("dead");
public void PlayWalkAnim(bool value)
{
animator.SetBool(walkHash, value);
}
public void PlayAttackAnim(bool value)
{
animator.SetBool(attackHash, value);
}
public void PlayeChaseAnim(bool value)
{
animator.SetBool(chaseHash, value);
}
public void PlayDeadAnim()
{
animator.SetTrigger(deadHash);
}
}
}

View File

@@ -1,19 +0,0 @@
using UnityEngine;
namespace Darkmatter.Presentation
{
public class EnemyAnimationController : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
}

View File

@@ -7,16 +7,8 @@ namespace Darkmatter.Presentation
{
public Animator animator;
protected readonly int moveXhash = Animator.StringToHash("MoveX");
protected readonly int moveYhash = Animator.StringToHash("MoveY");
protected readonly int jumpHash = Animator.StringToHash("Jump");
public void PlayMovementAnim(Vector2 velocity)
{
animator.SetFloat(moveXhash, velocity.x,0.4f,Time.deltaTime);
animator.SetFloat(moveYhash, velocity.y,0.4f, Time.deltaTime);
}
public void PlayJumpAnim()
{
animator.SetTrigger(jumpHash);

View File

@@ -12,6 +12,8 @@ namespace Darkmatter.Presentation
public class PlayerAnimController : HumonoidAnim, IPlayerAnim
{
private readonly int shootHash = Animator.StringToHash("IsShooting");
protected readonly int moveXhash = Animator.StringToHash("MoveX");
protected readonly int moveYhash = Animator.StringToHash("MoveY");
private readonly int reloadHash = Animator.StringToHash("Reload");
public TwoBoneIKConstraint HandOnGunIK; //for gunHand Ik
private Coroutine reloadCoroutine;
@@ -59,6 +61,12 @@ namespace Darkmatter.Presentation
}
public void PlayMovementAnim(Vector2 velocity)
{
animator.SetFloat(moveXhash, velocity.x, 0.4f, Time.deltaTime);
animator.SetFloat(moveYhash, velocity.y, 0.4f, Time.deltaTime);
}
public void PlayShootAnim()
{
Debug.Log("player Shoot");