몬스터 에셋 추가

This commit is contained in:
aube.lee
2025-01-30 18:41:41 +09:00
parent 61199eac78
commit f5741ba08f
209 changed files with 29094 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
using Assets.PixelFantasy.Common.Scripts;
using UnityEngine;
namespace Assets.PixelFantasy.PixelMonsters.Common.Scripts
{
[RequireComponent(typeof(Creature))]
[RequireComponent(typeof(Animator))]
public class InanimateControls : MonoBehaviour
{
private Creature _creature;
private Animator _animator;
public void Start()
{
_creature = GetComponent<Creature>();
_animator = GetComponent<Animator>();
_animator.SetBool("Idle", true);
}
public void Update()
{
if (Input.GetKeyDown(KeyCode.I))
{
SetState(idle: true);
}
else if (Input.GetKeyDown(KeyCode.D) && _animator.HasState(0, Animator.StringToHash("Destroy")))
{
SetState(destroy: true);
EffectManager.Instance.CreateSpriteEffect(_creature, "Fall");
}
else if (Input.GetKeyDown(KeyCode.O) && _animator.HasState(0, Animator.StringToHash("Open")))
{
SetState(open: true);
EffectManager.Instance.CreateSpriteEffect(_creature, "Fall");
}
else if (Input.GetKeyDown(KeyCode.L))
{
EffectManager.Instance.Blink(_creature);
}
}
private void SetState(bool idle = false, bool destroy = false, bool open = false)
{
_animator.SetBool("Idle", idle);
_animator.SetBool("Destroy", destroy);
_animator.SetBool("Open", open);
}
}
}