This repository has been archived on 2023-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
station_obscurum_unity/Assets/Scripts/Enemies/AI/SkinlessMonsterAnimator.cs

65 lines
1.1 KiB
C#
Raw Normal View History

2023-04-18 06:29:51 +02:00
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");
}
}