65 lines
1.1 KiB
C#
65 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEditor.Rendering;
|
|
using UnityEngine;
|
|
|
|
public class SkinlessMonsterAnimator : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private Animator animator;
|
|
private float speed = 0f;
|
|
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
animator.SetFloat("speed", speed);
|
|
|
|
}
|
|
|
|
public void StartMoving()
|
|
{
|
|
speed = 1;
|
|
|
|
|
|
}
|
|
public void StopMoving()
|
|
{
|
|
speed = 0;
|
|
|
|
}
|
|
public void Attack()
|
|
{
|
|
animator.SetTrigger("Attack");
|
|
}
|
|
/// <summary>
|
|
/// 0,1,2,3
|
|
/// </summary>
|
|
/// <param name="attackType"></param>
|
|
public void SetAttackType(int attackType)
|
|
{
|
|
animator.SetInteger("AttackIndex", attackType);
|
|
}
|
|
public void InLight()
|
|
{
|
|
animator.SetBool("InLight", true);
|
|
}
|
|
public void NotInLight()
|
|
{
|
|
animator.SetBool("InLight", false);
|
|
}
|
|
|
|
public void AttackScream()
|
|
{
|
|
animator.SetTrigger("AttackScream");
|
|
}
|
|
|
|
}
|