GetInfoString() public method

public GetInfoString ( ) : string
return string
Beispiel #1
0
        public override string GetInfoString()
        {
            EditorWrapper   previewEditor = this.previewEditor;
            AssetStoreAsset firstAsset    = AssetStoreAssetSelection.GetFirstAsset();

            if (firstAsset == null)
            {
                return("No item selected");
            }
            if ((previewEditor != null) && firstAsset.HasLivePreview)
            {
                return(previewEditor.GetInfoString());
            }
            return(string.Empty);
        }
Beispiel #2
0
        public override string GetInfoString()
        {
            EditorWrapper   editor = previewEditor;
            AssetStoreAsset a      = AssetStoreAssetSelection.GetFirstAsset();

            if (a == null)
            {
                return("No item selected");
            }

            if (editor != null && a.HasLivePreview)
            {
                return(editor.GetInfoString());
            }

            return("");
        }
Beispiel #3
0
        public override string GetInfoString()
        {
            EditorWrapper   previewEditor = this.previewEditor;
            AssetStoreAsset firstAsset    = AssetStoreAssetSelection.GetFirstAsset();
            string          result;

            if (firstAsset == null)
            {
                result = "No item selected";
            }
            else if (previewEditor != null && firstAsset.HasLivePreview)
            {
                result = previewEditor.GetInfoString();
            }
            else
            {
                result = "";
            }
            return(result);
        }
        // This is the preview area at the bottom of the screen
        void PreviewArea()
        {
            GUI.Box(new Rect(0, m_TopSize, position.width, m_PreviewSize), "", Styles.previewBackground);

            if (m_ListArea.GetSelection().Length == 0)
            {
                return;
            }

            EditorWrapper p = null;
            UnityObject   selectedObject = GetCurrentObject();

            if (m_PreviewSize < kPreviewExpandedAreaHeight)
            {
                // Get info string
                string s;
                if (selectedObject != null)
                {
                    p = m_EditorCache[selectedObject];
                    string typeName = ObjectNames.NicifyVariableName(selectedObject.GetType().Name);
                    if (p != null)
                    {
                        s = p.name + " (" + typeName + ")";
                    }
                    else
                    {
                        s = selectedObject.name + " (" + typeName + ")";
                    }

                    s += "      " + AssetDatabase.GetAssetPath(selectedObject);
                }
                else
                {
                    s = "None";
                }

                LinePreview(s, selectedObject, p);
            }
            else
            {
                if (m_EditorCache == null)
                {
                    m_EditorCache = new EditorCache(EditorFeatures.PreviewGUI);
                }

                // Get info string
                string s;
                if (selectedObject != null)
                {
                    p = m_EditorCache[selectedObject];
                    string typeName = ObjectNames.NicifyVariableName(selectedObject.GetType().Name);
                    if (p != null)
                    {
                        s = p.GetInfoString();
                        if (s != "")
                        {
                            s = p.name + "\n" + typeName + "\n" + s;
                        }
                        else
                        {
                            s = p.name + "\n" + typeName;
                        }
                    }
                    else
                    {
                        s = selectedObject.name + "\n" + typeName;
                    }

                    s += "\n" + AssetDatabase.GetAssetPath(selectedObject);
                }
                else
                {
                    s = "None";
                }

                // Make previews
                if (m_ShowWidePreview.faded != 0.0f)
                {
                    GUI.color = new Color(1, 1, 1, m_ShowWidePreview.faded);
                    WidePreview(m_PreviewSize, s, selectedObject, p);
                }
                if (m_ShowOverlapPreview.faded != 0.0f)
                {
                    GUI.color = new Color(1, 1, 1, m_ShowOverlapPreview.faded);
                    OverlapPreview(m_PreviewSize, s, selectedObject, p);
                }
                GUI.color = Color.white;
                m_EditorCache.CleanupUntouchedEditors();
            }
        }
Beispiel #5
0
        private void PreviewArea()
        {
            GUI.Box(new Rect(0f, this.m_TopSize, base.position.width, this.m_PreviewSize), string.Empty, this.m_Styles.previewBackground);
            if (this.m_ListArea.GetSelection().Length == 0)
            {
                return;
            }
            EditorWrapper editorWrapper = null;

            UnityEngine.Object currentObject = ObjectSelector.GetCurrentObject();
            if (this.m_PreviewSize < 75f)
            {
                string text;
                if (currentObject != null)
                {
                    editorWrapper = this.m_EditorCache[currentObject];
                    string str = ObjectNames.NicifyVariableName(currentObject.GetType().Name);
                    if (editorWrapper != null)
                    {
                        text = editorWrapper.name + " (" + str + ")";
                    }
                    else
                    {
                        text = currentObject.name + " (" + str + ")";
                    }
                    text = text + "      " + AssetDatabase.GetAssetPath(currentObject);
                }
                else
                {
                    text = "None";
                }
                this.LinePreview(text, currentObject, editorWrapper);
            }
            else
            {
                if (this.m_EditorCache == null)
                {
                    this.m_EditorCache = new EditorCache(EditorFeatures.PreviewGUI);
                }
                string text3;
                if (currentObject != null)
                {
                    editorWrapper = this.m_EditorCache[currentObject];
                    string text2 = ObjectNames.NicifyVariableName(currentObject.GetType().Name);
                    if (editorWrapper != null)
                    {
                        text3 = editorWrapper.GetInfoString();
                        if (text3 != string.Empty)
                        {
                            text3 = string.Concat(new string[]
                            {
                                editorWrapper.name,
                                "\n",
                                text2,
                                "\n",
                                text3
                            });
                        }
                        else
                        {
                            text3 = editorWrapper.name + "\n" + text2;
                        }
                    }
                    else
                    {
                        text3 = currentObject.name + "\n" + text2;
                    }
                    text3 = text3 + "\n" + AssetDatabase.GetAssetPath(currentObject);
                }
                else
                {
                    text3 = "None";
                }
                if (this.m_ShowWidePreview.faded != 0f)
                {
                    GUI.color = new Color(1f, 1f, 1f, this.m_ShowWidePreview.faded);
                    this.WidePreview(this.m_PreviewSize, text3, currentObject, editorWrapper);
                }
                if (this.m_ShowOverlapPreview.faded != 0f)
                {
                    GUI.color = new Color(1f, 1f, 1f, this.m_ShowOverlapPreview.faded);
                    this.OverlapPreview(this.m_PreviewSize, text3, currentObject, editorWrapper);
                }
                GUI.color = Color.white;
                this.m_EditorCache.CleanupUntouchedEditors();
            }
        }
Beispiel #6
0
 private void PreviewArea()
 {
     GUI.Box(new Rect(0f, this.m_TopSize, base.position.width, this.m_PreviewSize), string.Empty, this.m_Styles.previewBackground);
     if (this.m_ListArea.GetSelection().Length != 0)
     {
         EditorWrapper      p             = null;
         UnityEngine.Object currentObject = GetCurrentObject();
         if (this.m_PreviewSize < 75f)
         {
             string str;
             if (currentObject != null)
             {
                 p = this.m_EditorCache[currentObject];
                 string str2 = ObjectNames.NicifyVariableName(currentObject.GetType().Name);
                 if (p != null)
                 {
                     str = p.name + " (" + str2 + ")";
                 }
                 else
                 {
                     str = currentObject.name + " (" + str2 + ")";
                 }
                 str = str + "      " + AssetDatabase.GetAssetPath(currentObject);
             }
             else
             {
                 str = "None";
             }
             this.LinePreview(str, currentObject, p);
         }
         else
         {
             string infoString;
             if (this.m_EditorCache == null)
             {
                 this.m_EditorCache = new EditorCache(EditorFeatures.PreviewGUI);
             }
             if (currentObject != null)
             {
                 p = this.m_EditorCache[currentObject];
                 string str4 = ObjectNames.NicifyVariableName(currentObject.GetType().Name);
                 if (p != null)
                 {
                     infoString = p.GetInfoString();
                     if (infoString != string.Empty)
                     {
                         string[] textArray1 = new string[] { p.name, "\n", str4, "\n", infoString };
                         infoString = string.Concat(textArray1);
                     }
                     else
                     {
                         infoString = p.name + "\n" + str4;
                     }
                 }
                 else
                 {
                     infoString = currentObject.name + "\n" + str4;
                 }
                 infoString = infoString + "\n" + AssetDatabase.GetAssetPath(currentObject);
             }
             else
             {
                 infoString = "None";
             }
             if (this.m_ShowWidePreview.faded != 0f)
             {
                 GUI.color = new Color(1f, 1f, 1f, this.m_ShowWidePreview.faded);
                 this.WidePreview(this.m_PreviewSize, infoString, currentObject, p);
             }
             if (this.m_ShowOverlapPreview.faded != 0f)
             {
                 GUI.color = new Color(1f, 1f, 1f, this.m_ShowOverlapPreview.faded);
                 this.OverlapPreview(this.m_PreviewSize, infoString, currentObject, p);
             }
             GUI.color = Color.white;
             this.m_EditorCache.CleanupUntouchedEditors();
         }
     }
 }
        private void PreviewArea()
        {
            GUI.Box(new Rect(0.0f, this.m_TopSize, this.position.width, this.m_PreviewSize), string.Empty, this.m_Styles.previewBackground);
            if (this.m_ListArea.GetSelection().Length == 0)
            {
                return;
            }
            EditorWrapper p = (EditorWrapper)null;

            UnityEngine.Object currentObject = ObjectSelector.GetCurrentObject();
            if ((double)this.m_PreviewSize < 75.0)
            {
                string s;
                if (currentObject != (UnityEngine.Object)null)
                {
                    p = this.m_EditorCache[currentObject];
                    string str = ObjectNames.NicifyVariableName(currentObject.GetType().Name);
                    s = (p == null ? currentObject.name + " (" + str + ")" : p.name + " (" + str + ")") + "      " + AssetDatabase.GetAssetPath(currentObject);
                }
                else
                {
                    s = "None";
                }
                this.LinePreview(s, currentObject, p);
            }
            else
            {
                if (this.m_EditorCache == null)
                {
                    this.m_EditorCache = new EditorCache(EditorFeatures.PreviewGUI);
                }
                string s;
                if (currentObject != (UnityEngine.Object)null)
                {
                    p = this.m_EditorCache[currentObject];
                    string str1 = ObjectNames.NicifyVariableName(currentObject.GetType().Name);
                    string str2;
                    if (p != null)
                    {
                        string infoString = p.GetInfoString();
                        if (infoString != string.Empty)
                        {
                            str2 = p.name + "\n" + str1 + "\n" + infoString;
                        }
                        else
                        {
                            str2 = p.name + "\n" + str1;
                        }
                    }
                    else
                    {
                        str2 = currentObject.name + "\n" + str1;
                    }
                    s = str2 + "\n" + AssetDatabase.GetAssetPath(currentObject);
                }
                else
                {
                    s = "None";
                }
                if ((double)this.m_ShowWidePreview.faded != 0.0)
                {
                    GUI.color = new Color(1f, 1f, 1f, this.m_ShowWidePreview.faded);
                    this.WidePreview(this.m_PreviewSize, s, currentObject, p);
                }
                if ((double)this.m_ShowOverlapPreview.faded != 0.0)
                {
                    GUI.color = new Color(1f, 1f, 1f, this.m_ShowOverlapPreview.faded);
                    this.OverlapPreview(this.m_PreviewSize, s, currentObject, p);
                }
                GUI.color = Color.white;
                this.m_EditorCache.CleanupUntouchedEditors();
            }
        }