public void AddNativeClassID(int ID)
        {
            string name = UnityType.FindTypeByPersistentTypeID(ID).name;

            if (name.Length > 0)
            {
                this.allNativeClasses[ID] = name;
            }
        }
Пример #2
0
 internal GizmoInfo(Annotation annotation)
 {
     m_GizmoEnabled = annotation.gizmoEnabled > 0;
     m_IconEnabled  = annotation.iconEnabled > 0;
     m_ClassID      = annotation.classID;
     m_ScriptClass  = annotation.scriptClass;
     m_Flags        = annotation.flags;
     m_Name         = string.IsNullOrEmpty(m_ScriptClass)
         ? UnityType.FindTypeByPersistentTypeID(m_ClassID).name
         : m_Name = m_ScriptClass;
 }
Пример #3
0
        public void AddNativeClassID(int ID)
        {
            string className = UnityType.FindTypeByPersistentTypeID(ID).name;

            ////System.Console.WriteLine("Looking for ID {0} name {1} --> is manager? {2}", ID, className, functionalityGroups.ContainsValue(className));

            // Native class found
            if (className.Length > 0)
            {
                allNativeClasses[ID] = className;
            }
        }
Пример #4
0
        public void AddNativeClassID(int ID)
        {
            string name = UnityType.FindTypeByPersistentTypeID(ID).name;

            if (name.Length > 0)
            {
                this.allNativeClasses[ID] = name;
                if (!this.functionalityGroups.ContainsValue(name))
                {
                    this.nativeClasses[ID] = name;
                }
            }
        }
 public AInfo(bool gizmoEnabled, bool iconEnabled, int flags, int classID, string scriptClass)
 {
     m_GizmoEnabled = gizmoEnabled;
     m_IconEnabled  = iconEnabled;
     m_ClassID      = classID;
     m_ScriptClass  = scriptClass;
     m_Flags        = flags;
     if (m_ScriptClass == "")
     {
         m_DisplayText = UnityType.FindTypeByPersistentTypeID(m_ClassID).name;
     }
     else
     {
         m_DisplayText = m_ScriptClass;
     }
 }
        private void SyncToState()
        {
            // Sync annotations
            Annotation[] a = AnnotationUtility.GetAnnotations();

            string debuginfo = "";

            if (s_Debug)
            {
                debuginfo += "AnnotationWindow: SyncToState\n";
            }

            m_BuiltinAnnotations = new List <AInfo>();
            m_ScriptAnnotations  = new List <AInfo>();
            for (int i = 0; i < a.Length; ++i)
            {
                if (s_Debug)
                {
                    debuginfo += "   same as below: icon " + a[i].iconEnabled + " gizmo " + a[i].gizmoEnabled + "\n";
                }

                bool  ge   = (a[i].gizmoEnabled == 1) ? true : false;
                bool  ie   = (a[i].iconEnabled == 1) ? true : false;
                AInfo anno = new AInfo(ge, ie, a[i].flags, a[i].classID, a[i].scriptClass);

                if (anno.m_ScriptClass == "")
                {
                    m_BuiltinAnnotations.Add(anno);
                    if (s_Debug)
                    {
                        debuginfo += "   " + UnityType.FindTypeByPersistentTypeID(anno.m_ClassID).name + ": icon " + anno.m_IconEnabled + " gizmo " + anno.m_GizmoEnabled + "\n";
                    }
                }
                else
                {
                    m_ScriptAnnotations.Add(anno);
                    if (s_Debug)
                    {
                        debuginfo += "   " + a[i].scriptClass + ": icon " + anno.m_IconEnabled + " gizmo " + anno.m_GizmoEnabled + "\n";
                    }
                }
            }

            m_BuiltinAnnotations.Sort();
            m_ScriptAnnotations.Sort();

            // Sync recently changed annotations
            m_RecentAnnotations = new List <AInfo>();
            Annotation[] recent = AnnotationUtility.GetRecentlyChangedAnnotations();
            for (int i = 0; i < recent.Length && i < maxShowRecent; ++i)
            {
                // Note: ainfo can be null if script has been renamed.
                AInfo ainfo = GetAInfo(recent[i].classID, recent[i].scriptClass);
                if (ainfo != null)
                {
                    m_RecentAnnotations.Add(ainfo);
                }
            }

            m_SyncWithState = false;

            if (s_Debug)
            {
                Debug.Log(debuginfo);
            }
        }
Пример #7
0
        private void SyncToState()
        {
            Annotation[] annotations = AnnotationUtility.GetAnnotations();
            string       text        = "";

            if (AnnotationWindow.s_Debug)
            {
                text += "AnnotationWindow: SyncToState\n";
            }
            this.m_BuiltinAnnotations = new List <AInfo>();
            this.m_ScriptAnnotations  = new List <AInfo>();
            for (int i = 0; i < annotations.Length; i++)
            {
                if (AnnotationWindow.s_Debug)
                {
                    string text2 = text;
                    text = string.Concat(new object[]
                    {
                        text2,
                        "   same as below: icon ",
                        annotations[i].iconEnabled,
                        " gizmo ",
                        annotations[i].gizmoEnabled,
                        "\n"
                    });
                }
                bool  gizmoEnabled = annotations[i].gizmoEnabled == 1;
                bool  iconEnabled  = annotations[i].iconEnabled == 1;
                AInfo aInfo        = new AInfo(gizmoEnabled, iconEnabled, annotations[i].flags, annotations[i].classID, annotations[i].scriptClass);
                if (aInfo.m_ScriptClass == "")
                {
                    this.m_BuiltinAnnotations.Add(aInfo);
                    if (AnnotationWindow.s_Debug)
                    {
                        string text2 = text;
                        text = string.Concat(new object[]
                        {
                            text2,
                            "   ",
                            UnityType.FindTypeByPersistentTypeID(aInfo.m_ClassID).name,
                            ": icon ",
                            aInfo.m_IconEnabled,
                            " gizmo ",
                            aInfo.m_GizmoEnabled,
                            "\n"
                        });
                    }
                }
                else
                {
                    this.m_ScriptAnnotations.Add(aInfo);
                    if (AnnotationWindow.s_Debug)
                    {
                        string text2 = text;
                        text = string.Concat(new object[]
                        {
                            text2,
                            "   ",
                            annotations[i].scriptClass,
                            ": icon ",
                            aInfo.m_IconEnabled,
                            " gizmo ",
                            aInfo.m_GizmoEnabled,
                            "\n"
                        });
                    }
                }
            }
            this.m_BuiltinAnnotations.Sort();
            this.m_ScriptAnnotations.Sort();
            this.m_RecentAnnotations = new List <AInfo>();
            Annotation[] recentlyChangedAnnotations = AnnotationUtility.GetRecentlyChangedAnnotations();
            int          num = 0;

            while (num < recentlyChangedAnnotations.Length && num < 5)
            {
                AInfo aInfo2 = this.GetAInfo(recentlyChangedAnnotations[num].classID, recentlyChangedAnnotations[num].scriptClass);
                if (aInfo2 != null)
                {
                    this.m_RecentAnnotations.Add(aInfo2);
                }
                num++;
            }
            this.m_SyncWithState = false;
            if (AnnotationWindow.s_Debug)
            {
                Debug.Log(text);
            }
        }