using UnityEngine;

namespace pdinklag.CPW.Common
{
    public class SpotlightPrefab : MonoBehaviour
    {
        [Tooltip("The transform to use for yaw rotations.")]
        public Transform YawRotator;

        [Tooltip("The transform to use for pitch rotations.")]
        public Transform PitchRotator;

        [Tooltip("The mesh that has an emissive material that may be switched off.")]
        public MeshRenderer EmissiveMesh;

        [Tooltip("The light cone that will be colorized.")]
        public MeshRenderer LightCone;

        [Tooltip("The spotlight's default target.")]
        public Transform Target;

#if UNITY_EDITOR
        private void OnDrawGizmosSelected()
        {
            if (Target)
            {
                DebugExtension.DrawArrow(transform.position, Target.position - transform.position, Color.cyan);
            }
        }
#endif
    }
}
