private void PingItem(BitPickerItem item) { if (item.provider != null) { item.provider.OnPingItem(item); } }
private void SelectItem(BitPickerItem item) { Close(); if (item.provider != null) { item.provider.OnOpenItem(item, pattern); } }
public override void OnPingItem(BitPickerItem item) { var asset = AssetDatabase.LoadAssetAtPath <Object>(item.fullName); if (asset != null) { EditorGUIUtility.PingObject(asset); Selection.activeObject = asset; } }
public override Object[] GetItemDragReferences(BitPickerItem item) { var asset = AssetDatabase.LoadAssetAtPath <Object>(item.fullName); if (asset == null) { return(null); } return(new Object[] { asset }); }
public override void OnOpenItem(BitPickerItem item, string pattern) { var component = item.data as Component; if (component != null) { EditorGUIUtility.PingObject(component.gameObject); Selection.activeGameObject = component.gameObject; } }
public override Object[] GetItemDragReferences(BitPickerItem item) { var component = item.data as Component; if (component == null) { return(null); } return(new Object[] { component.gameObject }); }
public override void OnOpenItem(BitPickerItem item, string pattern) { if (AssetDatabase.IsValidFolder(item.fullName)) { EditorUtility.RevealInFinder(item.fullName); return; } var asset = AssetDatabase.LoadAssetAtPath <Object>(item.fullName); if (asset != null) { var extension = Path.GetExtension(item.fullName); foreach (var e in openAssetByExtensions) { if (extension == e) { var args = BitPickerHelper.GetArgs(pattern); var lineNumber = 0; if (int.TryParse(args, out lineNumber)) { AssetDatabase.OpenAsset(asset, lineNumber); } else { AssetDatabase.OpenAsset(asset); } return; } } EditorGUIUtility.PingObject(asset); Selection.activeObject = asset; } }
public override Texture2D GetItemIcon(BitPickerItem item) { var asset = AssetDatabase.LoadAssetAtPath <Object>(item.fullName); return(AssetPreview.GetMiniThumbnail(asset)); }
public override Texture2D GetItemIcon(BitPickerItem item) { var component = item.data as Component; return(AssetPreview.GetMiniTypeThumbnail(component.GetType())); }
public virtual Object[] GetItemDragReferences(BitPickerItem item) { return(null); }
public virtual void OnOpenItem(BitPickerItem item, string pattern) { Debug.LogFormat("On selected item {0} ({1})", item.name, item.fullName); }
public virtual void OnPingItem(BitPickerItem item) { }
public virtual Texture2D GetItemIcon(BitPickerItem item) { return(BitPickerItem.EmptyIcon); }