public void CleanupUntouchedEditors() { List <UnityEngine.Object> list = new List <UnityEngine.Object>(); foreach (UnityEngine.Object obj2 in this.m_EditorCache.Keys) { if (!this.m_UsedEditors.ContainsKey(obj2)) { list.Add(obj2); } } if (this.m_EditorCache != null) { foreach (UnityEngine.Object obj3 in list) { EditorWrapper wrapper = this.m_EditorCache[obj3]; this.m_EditorCache.Remove(obj3); if (wrapper != null) { wrapper.Dispose(); } } } this.m_UsedEditors.Clear(); }
private void WidePreview(float actualSize, string s, UnityEngine.Object o, EditorWrapper p) { float num = 5f; Rect position = new Rect(num, this.m_TopSize + num, actualSize - num * 2f, actualSize - num * 2f); Rect position2 = new Rect(this.m_PreviewSize + 3f, this.m_TopSize + (this.m_PreviewSize - 75f) * 0.5f, this.m_Parent.window.position.width - this.m_PreviewSize - 3f - num, 75f); if (p != null && p.HasPreviewGUI()) { p.OnPreviewGUI(position, this.m_Styles.previewTextureBackground); } else { if (o != null) { this.DrawObjectIcon(position, this.m_ListArea.m_SelectedObjectIcon); } } if (EditorGUIUtility.isProSkin) { EditorGUI.DropShadowLabel(position2, s, this.m_Styles.smallStatus); } else { GUI.Label(position2, s, this.m_Styles.smallStatus); } }
public void CleanupUntouchedEditors() { List <UnityEngine.Object> list = new List <UnityEngine.Object>(); foreach (UnityEngine.Object current in m_EditorCache.Keys) { if (!m_UsedEditors.ContainsKey(current)) { list.Add(current); } } if (m_EditorCache != null) { foreach (UnityEngine.Object current2 in list) { EditorWrapper editorWrapper = m_EditorCache[current2]; m_EditorCache.Remove(current2); if (editorWrapper != null) { editorWrapper.Dispose(); } } } m_UsedEditors.Clear(); }
public void CleanupUntouchedEditors() { if (m_EditorCache != null) { List <Object> toDelete = new List <Object>(); foreach (Object key in m_EditorCache.Keys) { if (!m_UsedEditors.ContainsKey(key)) { toDelete.Add(key); } } foreach (Object key in toDelete) { EditorWrapper ew = m_EditorCache[key]; m_EditorCache.Remove(key); if (ew == null) { continue; } ew.Dispose(); } } m_UsedEditors.Clear(); }
void WidePreview(float actualSize, string s, UnityObject o, EditorWrapper p) { float margin = kPreviewMargin; Rect previewRect = new Rect(margin, m_TopSize + margin, actualSize - margin * 2, actualSize - margin * 2); Rect labelRect = new Rect(m_PreviewSize + 3, m_TopSize + (m_PreviewSize - kPreviewExpandedAreaHeight) * 0.5f, m_Parent.window.position.width - m_PreviewSize - 3 - margin, kPreviewExpandedAreaHeight); if (p != null && p.HasPreviewGUI()) { p.OnPreviewGUI(previewRect, Styles.previewTextureBackground); } else if (o != null) { DrawObjectIcon(previewRect, m_ListArea.m_SelectedObjectIcon); } if (EditorGUIUtility.isProSkin) { EditorGUI.DropShadowLabel(labelRect, s, Styles.smallStatus); } else { GUI.Label(labelRect, s, Styles.smallStatus); } }
public void CleanupUntouchedEditors() { List <UnityEngine.Object> objectList = new List <UnityEngine.Object>(); using (Dictionary <UnityEngine.Object, EditorWrapper> .KeyCollection.Enumerator enumerator = this.m_EditorCache.Keys.GetEnumerator()) { while (enumerator.MoveNext()) { UnityEngine.Object current = enumerator.Current; if (!this.m_UsedEditors.ContainsKey(current)) { objectList.Add(current); } } } if (this.m_EditorCache != null) { using (List <UnityEngine.Object> .Enumerator enumerator = objectList.GetEnumerator()) { while (enumerator.MoveNext()) { UnityEngine.Object current = enumerator.Current; EditorWrapper editorWrapper = this.m_EditorCache[current]; this.m_EditorCache.Remove(current); if (editorWrapper != null) { editorWrapper.Dispose(); } } } } this.m_UsedEditors.Clear(); }
public static EditorWrapper Make(UnityEngine.Object obj, EditorFeatures requirements) { EditorWrapper editorWrapper = new EditorWrapper(); if (editorWrapper.Init(obj, requirements)) return editorWrapper; editorWrapper.Dispose(); return (EditorWrapper) null; }
public static EditorWrapper Make(UnityEngine.Object obj, EditorFeatures requirements) { EditorWrapper wrapper = new EditorWrapper(); if (wrapper.Init(obj, requirements)) { return wrapper; } wrapper.Dispose(); return null; }
public static EditorWrapper Make(UnityEngine.Object obj, EditorFeatures requirements) { EditorWrapper wrapper = new EditorWrapper(); if (wrapper.Init(obj, requirements)) { return(wrapper); } wrapper.Dispose(); return(null); }
public override void OnPreviewSettings() { AssetStoreAsset firstAsset = AssetStoreAssetSelection.GetFirstAsset(); if (firstAsset != null) { EditorWrapper previewEditor = this.previewEditor; if (previewEditor != null && firstAsset.HasLivePreview) { previewEditor.OnPreviewSettings(); } } }
public EditorWrapper this[UnityEngine.Object o] { get { this.m_UsedEditors[o] = true; if (this.m_EditorCache.ContainsKey(o)) { return(this.m_EditorCache[o]); } EditorWrapper wrapper3 = EditorWrapper.Make(o, this.m_Requirements); this.m_EditorCache[o] = wrapper3; return(wrapper3); } }
public void OnDisable() { EditorApplication.update = (EditorApplication.CallbackFunction)Delegate.Remove(EditorApplication.update, new EditorApplication.CallbackFunction(this.Update)); if (this.m_PreviewEditor != null) { this.m_PreviewEditor.Dispose(); this.m_PreviewEditor = null; } if (this.m_PreviewObject != null) { this.m_PreviewObject = null; } AssetStoreUtils.UnRegisterDownloadDelegate(this); }
public void OnDisable() { EditorApplication.update -= Update; if (m_PreviewEditor != null) { m_PreviewEditor.Dispose(); m_PreviewEditor = null; } if (m_PreviewObject != null) { m_PreviewObject = null; } AssetStoreUtils.UnRegisterDownloadDelegate(this); }
static public EditorWrapper Make(Object obj, EditorFeatures requirements) { EditorWrapper cp = new EditorWrapper(); if (cp.Init(obj, requirements)) { return(cp); } else { cp.Dispose(); return(null); } }
public EditorWrapper this[Object o] { get { m_UsedEditors[o] = true; if (m_EditorCache.ContainsKey(o)) { return(m_EditorCache[o]); } EditorWrapper w = EditorWrapper.Make(o, m_Requirements); return(m_EditorCache[o] = w); } }
public void OnDisable() { EditorApplication.update -= new EditorApplication.CallbackFunction(this.Update); if (this.m_PreviewEditor != null) { this.m_PreviewEditor.Dispose(); this.m_PreviewEditor = (EditorWrapper)null; } if (this.m_PreviewObject != (Object)null) { this.m_PreviewObject = (Object)null; } AssetStoreUtils.UnRegisterDownloadDelegate((ScriptableObject)this); }
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); }
public EditorWrapper this[UnityEngine.Object o] { get { m_UsedEditors[o] = true; if (m_EditorCache.ContainsKey(o)) { return(m_EditorCache[o]); } EditorWrapper editorWrapper = EditorWrapper.Make(o, m_Requirements); EditorWrapper editorWrapper2 = editorWrapper; m_EditorCache[o] = editorWrapper2; return(editorWrapper2); } }
public override void OnPreviewGUI(Rect r, GUIStyle background) { if (!(this.m_PreviewObject == null)) { EditorWrapper previewEditor = this.previewEditor; if (previewEditor != null && this.m_PreviewObject is AnimationClip) { previewEditor.OnPreviewGUI(r, background); } else { this.OnInteractivePreviewGUI(r, background); } } }
public static EditorWrapper Make(UnityEngine.Object obj, EditorFeatures requirements) { EditorWrapper editorWrapper = new EditorWrapper(); EditorWrapper result; if (editorWrapper.Init(obj, requirements)) { result = editorWrapper; } else { editorWrapper.Dispose(); result = null; } return(result); }
public override void OnPreviewSettings() { AssetStoreAsset asset = AssetStoreAssetSelection.GetFirstAsset(); if (asset == null) { return; } EditorWrapper editor = previewEditor; if (editor != null && asset.HasLivePreview) { editor.OnPreviewSettings(); } }
public override void OnPreviewSettings() { AssetStoreAsset firstAsset = AssetStoreAssetSelection.GetFirstAsset(); if (firstAsset == null) { return; } EditorWrapper previewEditor = this.previewEditor; if (previewEditor == null || !firstAsset.HasLivePreview) { return; } previewEditor.OnPreviewSettings(); }
private void LinePreview(string s, UnityEngine.Object o, EditorWrapper p) { if (this.m_ListArea.m_SelectedObjectIcon != null) { GUI.DrawTexture(new Rect(2f, (float)((int)(this.m_TopSize + 2f)), 16f, 16f), this.m_ListArea.m_SelectedObjectIcon, ScaleMode.StretchToFill); } Rect position = new Rect(20f, this.m_TopSize + 1f, base.position.width - 22f, 18f); if (EditorGUIUtility.isProSkin) { EditorGUI.DropShadowLabel(position, s, this.m_Styles.smallStatus); } else { GUI.Label(position, s, this.m_Styles.smallStatus); } }
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(""); }
void LinePreview(string s, UnityObject o, EditorWrapper p) { if (m_ListArea.m_SelectedObjectIcon != null) { GUI.DrawTexture(new Rect(2, (int)(m_TopSize + 2), 16, 16), m_ListArea.m_SelectedObjectIcon, ScaleMode.StretchToFill); } Rect labelRect = new Rect(20, m_TopSize + 1, position.width - 22, 18); if (EditorGUIUtility.isProSkin) { EditorGUI.DropShadowLabel(labelRect, s, Styles.smallStatus); } else { GUI.Label(labelRect, s, Styles.smallStatus); } }
public override void OnInteractivePreviewGUI(Rect r, GUIStyle background) { EditorWrapper previewEditor = this.previewEditor; if (previewEditor != null) { previewEditor.OnInteractivePreviewGUI(r, background); } AssetStoreAsset firstAsset = AssetStoreAssetSelection.GetFirstAsset(); if (firstAsset != null && !firstAsset.HasLivePreview && !string.IsNullOrEmpty(firstAsset.dynamicPreviewURL)) { GUIContent statusWheel = AssetStoreAssetInspector.StatusWheel; r.y += (r.height - (float)statusWheel.image.height) / 2f; r.x += (r.width - (float)statusWheel.image.width) / 2f; GUI.Label(r, AssetStoreAssetInspector.StatusWheel); base.Repaint(); } }
public EditorWrapper this[UnityEngine.Object o] { get { this.m_UsedEditors[o] = true; EditorWrapper result; if (this.m_EditorCache.ContainsKey(o)) { result = this.m_EditorCache[o]; } else { EditorWrapper editorWrapper = EditorWrapper.Make(o, this.m_Requirements); EditorWrapper editorWrapper2 = editorWrapper; this.m_EditorCache[o] = editorWrapper2; result = editorWrapper2; } return(result); } }
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); }
public override void OnInteractivePreviewGUI(Rect r, GUIStyle background) { EditorWrapper editor = previewEditor; if (editor != null) { editor.OnInteractivePreviewGUI(r, background); } // If the live preview is not available yes the show a spinner AssetStoreAsset a = AssetStoreAssetSelection.GetFirstAsset(); if (a != null && !a.HasLivePreview && !string.IsNullOrEmpty(a.dynamicPreviewURL)) { GUIContent c = StatusWheel; r.y += (r.height - c.image.height) / 2f; r.x += (r.width - c.image.width) / 2f; GUI.Label(r, StatusWheel); Repaint(); } }
private void OverlapPreview(float actualSize, string s, Object o, EditorWrapper p) { float x = 5f; Rect position = new Rect(x, this.m_TopSize + x, base.position.width - (x * 2f), actualSize - (x * 2f)); if ((p != null) && p.HasPreviewGUI()) { p.OnPreviewGUI(position, this.m_Styles.previewTextureBackground); } else if (o != null) { this.DrawObjectIcon(position, this.m_ListArea.m_SelectedObjectIcon); } if (EditorGUIUtility.isProSkin) { EditorGUI.DropShadowLabel(position, s, this.m_Styles.largeStatus); } else { EditorGUI.DoDropShadowLabel(position, EditorGUIUtility.TempContent(s), this.m_Styles.largeStatus, 0.3f); } }
public override void OnPreviewGUI(Rect r, GUIStyle background) { if (m_PreviewObject == null) { return; } EditorWrapper editor = previewEditor; // Special handling for animation clips because they only have // an interactive preview available which shows play button etc. // The OnPreviewGUI is also used for the small icons in the top // of the inspectors where buttons should not be rendered. if (editor != null && m_PreviewObject is AnimationClip) { editor.OnPreviewGUI(r, background); // currently renders nothing for animation clips } else { OnInteractivePreviewGUI(r, background); } }
void OverlapPreview(float actualSize, string s, UnityObject o, EditorWrapper p) { float margin = kPreviewMargin; Rect previewRect = new Rect(margin, m_TopSize + margin, position.width - margin * 2, actualSize - margin * 2); if (p != null && p.HasPreviewGUI()) { p.OnPreviewGUI(previewRect, Styles.previewTextureBackground); } else if (o != null) { DrawObjectIcon(previewRect, m_ListArea.m_SelectedObjectIcon); } if (EditorGUIUtility.isProSkin) { EditorGUI.DropShadowLabel(previewRect, s, Styles.largeStatus); } else { EditorGUI.DoDropShadowLabel(previewRect, EditorGUIUtility.TempContent(s), Styles.largeStatus, .3f); } }
private void OverlapPreview(float actualSize, string s, UnityEngine.Object o, EditorWrapper p) { float num = 5f; Rect position = new Rect(num, this.m_TopSize + num, base.position.width - num * 2f, actualSize - num * 2f); if (p != null && p.HasPreviewGUI()) { p.OnPreviewGUI(position, this.m_Styles.previewTextureBackground); } else { if (o != null) { this.DrawObjectIcon(position, this.m_ListArea.m_SelectedObjectIcon); } } if (EditorGUIUtility.isProSkin) { EditorGUI.DropShadowLabel(position, s, this.m_Styles.largeStatus); } else { EditorGUI.DoDropShadowLabel(position, EditorGUIUtility.TempContent(s), this.m_Styles.largeStatus, 0.3f); } }
public void OnDisable() { EditorApplication.update -= new EditorApplication.CallbackFunction(this.Update); if (this.m_PreviewEditor != null) { this.m_PreviewEditor.Dispose(); this.m_PreviewEditor = (EditorWrapper) null; } if (this.m_PreviewObject != (Object) null) this.m_PreviewObject = (Object) null; AssetStoreUtils.UnRegisterDownloadDelegate((ScriptableObject) this); }
private void WidePreview(float actualSize, string s, Object o, EditorWrapper p) { float x = 5f; Rect position = new Rect(x, this.m_TopSize + x, actualSize - (x * 2f), actualSize - (x * 2f)); Rect rect2 = new Rect(this.m_PreviewSize + 3f, this.m_TopSize + ((this.m_PreviewSize - 75f) * 0.5f), ((base.m_Parent.window.position.width - this.m_PreviewSize) - 3f) - x, 75f); if ((p != null) && p.HasPreviewGUI()) { p.OnPreviewGUI(position, this.m_Styles.previewTextureBackground); } else if (o != null) { this.DrawObjectIcon(position, this.m_ListArea.m_SelectedObjectIcon); } if (EditorGUIUtility.isProSkin) { EditorGUI.DropShadowLabel(rect2, s, this.m_Styles.smallStatus); } else { GUI.Label(rect2, s, this.m_Styles.smallStatus); } }
private void WidePreview(float actualSize, string s, UnityEngine.Object o, EditorWrapper p) { float x = 5f; Rect position1 = new Rect(x, this.m_TopSize + x, actualSize - x * 2f, actualSize - x * 2f); Rect position2 = new Rect(this.m_PreviewSize + 3f, this.m_TopSize + (float) (((double) this.m_PreviewSize - 75.0) * 0.5), (float) ((double) this.m_Parent.window.position.width - (double) this.m_PreviewSize - 3.0) - x, 75f); if (p != null && p.HasPreviewGUI()) p.OnPreviewGUI(position1, this.m_Styles.previewTextureBackground); else if (o != (UnityEngine.Object) null) this.DrawObjectIcon(position1, this.m_ListArea.m_SelectedObjectIcon); if (EditorGUIUtility.isProSkin) EditorGUI.DropShadowLabel(position2, s, this.m_Styles.smallStatus); else GUI.Label(position2, s, this.m_Styles.smallStatus); }