using System; using System.Collections.Generic; using UnityEngine; using Random = Unity.Mathematics.Random; namespace Creatures.Boxsack { public class BoxsackVitalReaction : MonoBehaviour, IVitalReaction { public Animation boxsackAnimation; public List hitSounds; [Range(0f, 1f)] public float hitSoundVolume; public void Hit() { boxsackAnimation.Stop(); boxsackAnimation.Play("HitAnimation"); Random rnd = new Random((uint)DateTime.Now.Ticks); AudioSource.PlayClipAtPoint(hitSounds[rnd.NextInt(0, hitSounds.Count)], transform.position, hitSoundVolume); print("Boxsack Vital Reaction Hit"); } public void Heal() { print("Boxsack Vital Reaction Heal"); } } }