示例#1
0
            public void Initialize(ConnectionsControl owner, PackedMemorySnapshot snapshot, int arrayIndex)
            {
                m_Owner       = owner;
                m_Snapshot    = snapshot;
                m_StaticField = m_Snapshot.managedStaticFields[arrayIndex];

                displayName = m_Snapshot.managedTypes[m_StaticField.managedTypesArrayIndex].name;
                address     = 0;
                m_Value     = "static " + m_Snapshot.managedTypes[m_StaticField.managedTypesArrayIndex].name + "." + m_Snapshot.managedTypes[m_StaticField.managedTypesArrayIndex].fields[m_StaticField.fieldIndex].name;
            }
示例#2
0
            public void Initialize(ConnectionsControl owner, PackedMemorySnapshot snapshot, int gcHandleArrayIndex)
            {
                m_Owner    = owner;
                m_Snapshot = snapshot;
                m_GCHandle = new RichGCHandle(m_Snapshot, gcHandleArrayIndex);

                displayName = "GCHandle";
                m_Value     = m_GCHandle.managedObject.isValid ? m_GCHandle.managedObject.type.name : "";
                address     = m_GCHandle.managedObjectAddress;
            }
示例#3
0
            public void Initialize(ConnectionsControl owner, PackedMemorySnapshot snapshot, int arrayIndex)
            {
                m_Owner         = owner;
                m_ManagedObject = new RichManagedObject(snapshot, arrayIndex);

                displayName = m_ManagedObject.type.name;
                address     = m_ManagedObject.address;
                m_Value     = m_ManagedObject.nativeObject.isValid ? m_ManagedObject.nativeObject.name : "";
                m_Tooltip   = PackedManagedTypeUtility.GetInheritanceAsString(snapshot, m_ManagedObject.type.packed.managedTypesArrayIndex);
            }
        protected override void OnCreate()
        {
            base.OnCreate();

            m_ReferencesControl = new ConnectionsControl(window, GetPrefsKey(() => m_ReferencedByControl), new TreeViewState());
            m_ReferencesControl.Reload();

            m_ReferencesSearchField = new HeSearchField(window);
            m_ReferencesSearchField.downOrUpArrowKeyPressed += m_ReferencesControl.SetFocusAndEnsureSelectedItem;
            m_ReferencesControl.findPressed += m_ReferencesSearchField.SetFocus;

            m_ReferencedByControl = new ConnectionsControl(window, GetPrefsKey(() => m_ReferencedByControl), new TreeViewState());
            m_ReferencedByControl.Reload();

            m_ReferencedBySearchField = new HeSearchField(window);
            m_ReferencedBySearchField.downOrUpArrowKeyPressed += m_ReferencesControl.SetFocusAndEnsureSelectedItem;
            m_ReferencedByControl.findPressed += m_ReferencedBySearchField.SetFocus;

            m_SplitterValue = EditorPrefs.GetFloat(GetPrefsKey(() => m_SplitterValue), m_SplitterValue);
        }
示例#5
0
            public void Initialize(ConnectionsControl owner, PackedMemorySnapshot snapshot, PackedNativeUnityEngineObject nativeObject)
            {
                m_Owner        = owner;
                m_Snapshot     = snapshot;
                m_NativeObject = new RichNativeObject(snapshot, nativeObject.nativeObjectsArrayIndex);

                m_Value     = m_NativeObject.name;
                address     = m_NativeObject.address;
                displayName = m_NativeObject.type.name;

                // If it's a MonoBehaviour or ScriptableObject, use the C# typename instead
                // It makes it easier to understand what it is, otherwise everything displays 'MonoBehaviour' only.
                if (m_NativeObject.type.IsSubclassOf(m_Snapshot.coreTypes.nativeMonoBehaviour) || m_NativeObject.type.IsSubclassOf(m_Snapshot.coreTypes.nativeScriptableObject))
                {
                    string monoScriptName;
                    if (m_Snapshot.FindNativeMonoScriptType(m_NativeObject.packed.nativeObjectsArrayIndex, out monoScriptName) != -1)
                    {
                        if (!string.IsNullOrEmpty(monoScriptName))
                        {
                            displayName = monoScriptName;
                        }
                    }
                }
            }