public static void SetGizmoIconEnabled(Type script, bool enabled)
        {
#if UNITY_2019_1_OR_NEWER
            var annotations = AnnotationUtility.GetAnnotations();
            var annotation  = annotations.FirstOrDefault(x => x.scriptClass.Contains(script.Name));
            AnnotationUtility.SetIconEnabled(annotation.classID, annotation.scriptClass, enabled ? 1 : 0);
#else
            Type annotationUtility = typeof(Editor).Assembly.GetType("UnityEditor.AnnotationUtility");

            //Case 1294866 : Seems that getting the annotation array remove the warning
            //Might be initializing something that is missing otherwise
            MethodInfo getAnnotations = annotationUtility.GetMethod("GetAnnotations",
                                                                    BindingFlags.Static | BindingFlags.NonPublic,
                                                                    null,
                                                                    new Type[] { },
                                                                    null);
            var annotations = getAnnotations.Invoke(null, new object[] {});

            MethodInfo setGizmoIconEnabled = annotationUtility.GetMethod("SetIconEnabled",
                                                                         BindingFlags.Static | BindingFlags.NonPublic,
                                                                         null,
                                                                         new Type[] { typeof(int), typeof(string), typeof(int) },
                                                                         null);
            var name = script.Name;
            setGizmoIconEnabled.Invoke(null, new object[] { 114, name, enabled ? 1 : 0 });
#endif
        }
        public static void SetGizmoIconEnabled(Type script, bool enabled)
        {
#if UNITY_2019_1_OR_NEWER
            var annotations = AnnotationUtility.GetAnnotations();
            var annotation  = annotations.FirstOrDefault(x => x.scriptClass.Contains(script.Name));
            AnnotationUtility.SetIconEnabled(annotation.classID, annotation.scriptClass, enabled ? 1 : 0);
#else
            Type       annotationUtility   = typeof(Editor).Assembly.GetType("UnityEditor.AnnotationUtility");
            MethodInfo setGizmoIconEnabled = annotationUtility.GetMethod("SetIconEnabled",
                                                                         BindingFlags.Static | BindingFlags.NonPublic,
                                                                         null,
                                                                         new Type[] { typeof(int), typeof(string), typeof(int) },
                                                                         null);
            var name = script.Name;
            setGizmoIconEnabled.Invoke(null, new object[] { 114, name, enabled ? 1 : 0 });
#endif
        }