Exemplo n.º 1
0
    //名前検索してPathLabelButton作成
    void FindAndCreateLabel(string name, string type = "")
    {
        string filter = name;

        if (type != "")
        {
            filter += " t:" + type;
        }
        string[] guids = AssetDatabase.FindAssets(filter);

        if (guids != null && guids.Length > 0)
        {
            foreach (var guid in guids)
            {
                string path = AssetDatabase.GUIDToAssetPath(guid);
                if (exceptPackages &&
                    path.StartsWith("Packages/"))
                {
                    continue;
                }
                var pathLabel = new PathLabelButton(path, guid, type);
                pathLabel.callback = CheckUsing;
                pathLabels.Add(pathLabel);
                pathLabel.ShowButton();
            }
        }
    }
Exemplo n.º 2
0
 //path押下時の処理
 void CheckUsing(PathLabelButton pathLabel)
 {
     //検索リストの見た目の更新
     foreach (var label in pathLabels)
     {
         if (!pathLabel.Equals(label))
         {
             label.SetActive(false);
         }
     }
     pathLabel.SetActive(true);
     foundScroll = Vector2.zero;
     CheckUsing(pathLabel.path, pathLabel.guid);
 }