コード例 #1
0
        public static void ApplyGizmoInfo(GizmoInfo info, bool addToRecentlyChanged = true)
        {
            int gizmoEnabled = info.gizmoEnabled ? 1 : 0;

            AnnotationUtility.SetGizmoEnabled(info.classID, info.scriptClass, gizmoEnabled, addToRecentlyChanged);
            AnnotationUtility.SetIconEnabled(info.classID, info.scriptClass, info.iconEnabled ? 1 : 0);
        }
コード例 #2
0
        public static bool TryGetGizmoInfo(Type type, out GizmoInfo info)
        {
            GetAnnotationIdAndClass(type, out var id, out var name);
            var annotation = AnnotationUtility.GetAnnotation(id, name);

            if (annotation.gizmoEnabled == -1 && annotation.iconEnabled == -1 && annotation.flags == -1)
            {
                info = new GizmoInfo();
                return(false);
            }

            info = new GizmoInfo(annotation);
            return(true);
        }