Preview:
using UnityEngine;
using Photon.Realtime;
using UnityEngine.UI;

public class HitmarkerItem : MonoBehaviour
{
    public float destroyTime = 0.2f;
    
    public AudioSource _audioSource;
    public Image _image;

    public Color headshotColor = Color.red;
    public float pitch = 1f;
    
    public void Initialize(bool isHeadshot)
    {
        if (isHeadshot)
        {
            _image.color = headshotColor;
            _audioSource.pitch = pitch;
        }
        
        _audioSource.Play();
        
        Destroy(gameObject, destroyTime);
    }
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter