Initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using Darkmatter.Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Darkmatter.Presentation
|
||||
{
|
||||
public abstract class HumonoidAnim : MonoBehaviour, IHumonoidAnim
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0456d664cb3848c4bb8a381db3fe819a
|
||||
@@ -0,0 +1,14 @@
|
||||
using Darkmatter.Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Darkmatter.Presentation
|
||||
{
|
||||
public class PlayerAnimController : HumonoidAnim, IPlayerAnim
|
||||
{
|
||||
private readonly int shootHash = Animator.StringToHash("IsShooting");
|
||||
public void PlayShootAnim()
|
||||
{
|
||||
Debug.Log("player Shoot");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0bcf4be752bf7ad448fd187a62487726
|
||||
Reference in New Issue
Block a user