예제 #1
0
 private void PingItem(BitPickerItem item)
 {
     if (item.provider != null)
     {
         item.provider.OnPingItem(item);
     }
 }
예제 #2
0
        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 });
        }
예제 #5
0
        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;
            }
        }
예제 #6
0
        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));
        }
예제 #9
0
        public override Texture2D GetItemIcon(BitPickerItem item)
        {
            var component = item.data as Component;

            return(AssetPreview.GetMiniTypeThumbnail(component.GetType()));
        }
예제 #10
0
 public virtual Object[] GetItemDragReferences(BitPickerItem item)
 {
     return(null);
 }
예제 #11
0
 public virtual void OnOpenItem(BitPickerItem item, string pattern)
 {
     Debug.LogFormat("On selected item {0} ({1})", item.name, item.fullName);
 }
예제 #12
0
 public virtual void OnPingItem(BitPickerItem item)
 {
 }
예제 #13
0
 public virtual Texture2D GetItemIcon(BitPickerItem item)
 {
     return(BitPickerItem.EmptyIcon);
 }