using UnityEngine;

namespace ScrambleKit.Hits
{
    public class Corpse : MonoBehaviour
    {
        public Transform CorpsePrefab;
        public bool CopyOwnersScaleRotation = false;
        
        void Dying()
        {
            if (CorpsePrefab == null)
                return;

            Transform corpse = Instantiate(CorpsePrefab);
            corpse.position = transform.root.position;

            if(CopyOwnersScaleRotation)
            {
                corpse.localScale = transform.root.localScale;
                corpse.localEulerAngles = transform.root.localEulerAngles;
            }
        }
    }

}