Search Unity

Showcase Node finder for unity visual scripting

Discussion in 'Visual Scripting' started by myanko, Oct 18, 2021.

  1. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    108
    After deleting the previous version and then installing the 0.5 version it still shows 0.4 in the finder window and can't find the scene hierarchy tab anywhere. The only thing that's different from 0.4 is that I'm no longer getting any errors. At least yet. Crossing fingers :D
     
  2. myanko

    myanko

    Joined:
    Nov 9, 2013
    Posts:
    56
    Oups I forgot to manually increament the value...
     
  3. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    108
    Thanks for the quick response! And how about the scene hierarchy feature? Couldn't find it anywhere. Since I had to use more than one script machine in the project it would be very useful to be able to find nodes in all the machines present in the scene.
     
  4. myanko

    myanko

    Joined:
    Nov 9, 2013
    Posts:
    56
    I'm worried, do you mean that the hierarchy tab don't show ?I
     

    Attached Files:

  5. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    108
    Apologies, my bad. I expected 0.5 to have a new tab or something. Everything is working flawlessly so far and I thank you.
     
  6. myanko

    myanko

    Joined:
    Nov 9, 2013
    Posts:
    56
    Ouff. Nice to ear. I you find anything, I would be glad to help.
     
  7. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    108
    Hello and hope you're doing well. I want to express my gratitude again for this asset. It's the most important one for sure in my arsenal :)! I absolutely can't imagine working without it now. Do people use it?? What are the stats I wonder? :DHave all visual scripters found it...? Visual Scripting is practically impossible without it for mid to large projects.

    I wish Unity buys it for a lot of money as it's an absolute necessity for UVS!
     
  8. brooklyn

    brooklyn

    Joined:
    Oct 22, 2013
    Posts:
    1
    Such great work!

    It’s free? Let us pay you!
     
    myanko and Ignacii like this.
  9. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    108
    myanko likes this.
  10. artokarsus_unity

    artokarsus_unity

    Joined:
    Mar 18, 2019
    Posts:
    9
    Great asset! Thank a lot, it's working, but in my case - I think it's working partially, cause it's throwing this errors (JFYI):

    1.jpg 2.jpg 3.jpg 4.jpg
     
  11. myanko

    myanko

    Joined:
    Nov 9, 2013
    Posts:
    56
    It would be nice, but I think it will never happen. :p. I'm just glad it can help people and to be able to contribute with something to share my love for visual scripting and game making.
     
    Ignacii likes this.
  12. myanko

    myanko

    Joined:
    Nov 9, 2013
    Posts:
    56
  13. myanko

    myanko

    Joined:
    Nov 9, 2013
    Posts:
    56
  14. artokarsus_unity

    artokarsus_unity

    Joined:
    Mar 18, 2019
    Posts:
    9
    Yes, you right, I'm on M1
     
  15. literacy

    literacy

    Joined:
    Nov 14, 2021
    Posts:
    56
    I installed this as soon as it came out, and it was amazing and worked perfectly!

    I upgraded to 0.5 shortly after the update came out, and the search only seems to find some nodes now and not others. As far as I can tell, it only seems to search subgraphs that are saved to disk (not embedded graphs). It also will search a subgraph if I'm currently in the subgraph (the results will show in the Current Graph).

    I deleted the package and re-installed it and it's still not working as well as before. Any ideas? Thank you for your amazing work!!
     
  16. myanko

    myanko

    Joined:
    Nov 9, 2013
    Posts:
    56
    We added a new feature, to be able to narrow the search in graphs to what you see in current graph or to let the user grab more stuff.

    Sorry for the late reply. This new feature is possibly the reason why you are not getting as much stuff as before.

    Put your state Context to All and you should get the same expected results from before.
    upload_2023-10-5_11-26-17.png

    State contexts
    - All:
    Search in all the graphs, subgraph and
    - Current: Search only in the currently opened graph, won't search in the parent graph or in subgraphs.
    - Children: Enable the search from current graph and all the embedded graphs,macros.
     
    literacy likes this.
  17. myanko

    myanko

    Joined:
    Nov 9, 2013
    Posts:
    56
    We are looking at some fix for M1 and harmony dll. Don't know when it will come out.
     
  18. termway

    termway

    Joined:
    Jul 5, 2012
    Posts:
    84
    Hello there,

    I also had the same problem with Embed graph in prefab.
    Node are not found in embed prefab with the State Context: All.

    But I got this log which indicate an exception. I think it would be better if it was a log error btw.

    Code (CSharp):
    1. encountered an error while searching in all scripts Object reference not set to an instance of an object   at Unity.VisualScripting.UVSFinder.GraphElement.GetNameFromSpecificTypes (Unity.VisualScripting.IGraphElement ge) [0x01366] in C:\ws\sentry_games_git\obec\obec\Assets\ThirdParties\com.sokatoa.uvs.finder\Editor\Serialization\GraphElement.cs:278
    2.   at Unity.VisualScripting.UVSFinder.GraphElement.GetElementName (Unity.VisualScripting.IGraphElement ge) [0x00007] in C:\ws\sentry_games_git\obec\obec\Assets\ThirdParties\com.sokatoa.uvs.finder\Editor\Serialization\GraphElement.cs:20
    3.   at Unity.VisualScripting.UVSFinder.UVSSearchProvider.isFoundElement (Unity.VisualScripting.UVSFinder.SearchContext searchContext, Unity.VisualScripting.IGraphElement currentElement) [0x00001] in C:\ws\sentry_games_git\obec\obec\Assets\ThirdParties\com.sokatoa.uvs.finder\Editor\UVSSearchProvider.cs:482
    4.   at Unity.VisualScripting.UVSFinder.UVSSearchProvider.GetElementsFromIGraph (Unity.VisualScripting.GraphReference reference, Unity.VisualScripting.IGraph graph, System.String assetPath, Unity.VisualScripting.UVSFinder.SearchContext searchContext, Unity.VisualScripting.UVSFinder.ResultItemList searchItems) [0x0003a] in C:\ws\sentry_games_git\obec\obec\Assets\ThirdParties\com.sokatoa.uvs.finder\Editor\UVSSearchProvider.cs:275
    5.   at Unity.VisualScripting.UVSFinder.UVSSearchProvider.GetElementsFromStateGraph (Unity.VisualScripting.GraphReference reference, Unity.VisualScripting.StateGraph graph, System.String assetPath, Unity.VisualScripting.UVSFinder.SearchContext searchContext, Unity.VisualScripting.UVSFinder.ResultItemList searchItems) [0x00012] in C:\ws\sentry_games_git\obec\obec\Assets\ThirdParties\com.sokatoa.uvs.finder\Editor\UVSSearchProvider.cs:323
    6.   at Unity.VisualScripting.UVSFinder.UVSSearchProvider.FindNodesFromStateGraphAssetGuid (System.String guid, Unity.VisualScripting.UVSFinder.SearchContext searchContext, Unity.VisualScripting.UVSFinder.ResultItemList searchItems) [0x00056] in C:\ws\sentry_games_git\obec\obec\Assets\ThirdParties\com.sokatoa.uvs.finder\Editor\UVSSearchProvider.cs:212
    7.   at Unity.VisualScripting.UVSFinder.UVSSearchProvider.PerformSearchAll (System.String keyword, System.Boolean isExact) [0x0006d] in C:\ws\sentry_games_git\obec\obec\Assets\ThirdParties\com.sokatoa.uvs.finder\Editor\UVSSearchProvider.cs:155
    8. UnityEngine.Debug:Log (object)
    9. Unity.VisualScripting.UVSFinder.UVSSearchProvider:PerformSearchAll (string,bool) (at Assets/ThirdParties/com.sokatoa.uvs.finder/Editor/UVSSearchProvider.cs:183)
    10. Unity.VisualScripting.UVSFinder.UVSFinder:PerformSearch (string,bool) (at Assets/ThirdParties/com.sokatoa.uvs.finder/Editor/UVSFinder.cs:219)
    11. Unity.VisualScripting.UVSFinder.UVSFinder:OnSearchAction (string,bool) (at Assets/ThirdParties/com.sokatoa.uvs.finder/Editor/UVSFinder.cs:347)
    12. Unity.VisualScripting.UVSFinder.UVSGraphElementWidgetExt:OnFind (string) (at Assets/ThirdParties/com.sokatoa.uvs.finder/Editor/ContextExtension/UVSGraphElementWidgetExt.cs:181)
    13. Unity.VisualScripting.UVSFinder.UVSGraphElementWidgetExt/<>c__DisplayClass1_0:<Postfix1>b__2 () (at Assets/ThirdParties/com.sokatoa.uvs.finder/Editor/ContextExtension/UVSGraphElementWidgetExt.cs:131)
    14. Unity.VisualScripting.GraphWindow:OnGUI () (at Assets/ThirdParties/com.unity.visualscripting@1.8.0/Editor/VisualScripting.Core/Windows/GraphWindow.cs:740)
    15. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    16.  
    So the fix was pretty straightforward for me:

    upload_2023-10-6_15-36-8.png
     
    Last edited: Oct 6, 2023
    myanko likes this.
  19. literacy

    literacy

    Joined:
    Nov 14, 2021
    Posts:
    56
    Thank you for the reply!

    Just checked my Preferences, and the State Context was already set to All.

    upload_2023-10-8_11-20-32.png

    I changed it to something else just now and then changed it back, to see if that would fix it... but seeing the same results as before.
     
  20. literacy

    literacy

    Joined:
    Nov 14, 2021
    Posts:
    56
    I saw the mention of an error in the Console log, so I did a search (that found nothing) and checked the Console. Sure enough, there's an error! (I anonymized my folder names, but other than that it's a cut and paste of the error.):

    encountered an error while searching in all scripts Object reference not set to an instance of an object at Unity.VisualScripting.UVSFinder.GraphElement.GetNameFromSpecificTypes (Unity.VisualScripting.IGraphElement ge) [0x00f7a] in C:\Users\username\Unity\My Project\Assets\com.sokatoa.uvs.finder\Editor\Serialization\GraphElement.cs:246
    at Unity.VisualScripting.UVSFinder.GraphElement.GetElementName (Unity.VisualScripting.IGraphElement ge) [0x00006] in C:\Users\username\Unity\My Project\Assets\com.sokatoa.uvs.finder\Editor\Serialization\GraphElement.cs:20
    at Unity.VisualScripting.UVSFinder.UVSSearchProvider.isFoundElement (Unity.VisualScripting.UVSFinder.SearchContext searchContext, Unity.VisualScripting.IGraphElement currentElement) [0x00000] in C:\Users\username\Unity\My Project\Assets\com.sokatoa.uvs.finder\Editor\UVSSearchProvider.cs:482
    at Unity.VisualScripting.UVSFinder.UVSSearchProvider.GrabElements (Unity.VisualScripting.IGraphElement e, System.String stateName, UnityEngine.GameObject gameObject, Unity.VisualScripting.GraphReference reference, Unity.VisualScripting.IGraph graph, System.String assetPath, Unity.VisualScripting.UVSFinder.SearchContext searchContext, Unity.VisualScripting.UVSFinder.ResultItemList searchItems) [0x002d5] in C:\Users\username\Unity\My Project\Assets\com.sokatoa.uvs.finder\Editor\UVSSearchProvider.cs:439
    at Unity.VisualScripting.UVSFinder.UVSSearchProvider.FindNodesFromScriptGraphAssetGuid (System.String guid, Unity.VisualScripting.UVSFinder.SearchContext searchContext, Unity.VisualScripting.UVSFinder.ResultItemList searchItems) [0x0006b] in C:\Users\username\Unity\My Project\Assets\com.sokatoa.uvs.finder\Editor\UVSSearchProvider.cs:197
    at Unity.VisualScripting.UVSFinder.UVSSearchProvider.PerformSearchAll (System.String keyword, System.Boolean isExact) [0x0002c] in C:\Users\username\Unity\My Project\Assets\com.sokatoa.uvs.finder\Editor\UVSSearchProvider.cs:150
    UnityEngine.Debug:Log (object)
    Unity.VisualScripting.UVSFinder.UVSSearchProvider:performSearchAll (string,bool) (at C:/Users/username/Unity/My Project/Assets/com.sokatoa.uvs.finder/Editor/UVSSearchProvider.cs:183)
    Unity.VisualScripting.UVSFinder.UVSFinder:performSearch (string,bool) (at C:/Users/username/Unity/My Project/Assets/com.sokatoa.uvs.finder/Editor/UVSFinder.cs:219)
    Unity.VisualScripting.UVSFinder.UVSFinder:OnSearchAction (string,bool) (at C:/Users/username/Unity/My Project/Assets/com.sokatoa.uvs.finder/Editor/UVSFinder.cs:347)
    Unity.VisualScripting.UVSFinder.UVSFinder:OnSearchAction () (at C:/Users/username/Unity/My Project/Assets/com.sokatoa.uvs.finder/Editor/UVSFinder.cs:356)
    Unity.VisualScripting.UVSFinder.UVSFinder:OnKeyUp (UnityEngine.UIElements.KeyUpEvent) (at C:/Users/username/Unity/My Project/Assets/com.sokatoa.uvs.finder/Editor/UVSFinder.cs:308)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
     
  21. termway

    termway

    Joined:
    Jul 5, 2012
    Posts:
    84
    I think you have an error similar to mine. I would suggest you to open the GraphElement.cs file to add ? character in the line 246.
    Code (CSharp):
    1. name = $"{subgraph.nest?.macro.name} [SubGraph]";
     
  22. literacy

    literacy

    Joined:
    Nov 14, 2021
    Posts:
    56
    Thanks! I tried that, but it didn't work alas...
     
  23. termway

    termway

    Joined:
    Jul 5, 2012
    Posts:
    84
    Yeah my bad! The null-conditional operator should be placed after the macro property because it is this one that is null for some reasons.
    Code (CSharp):
    1. name = $"{subgraph.nest.macro?.name} [SubGraph]";
     
    literacy likes this.
  24. literacy

    literacy

    Joined:
    Nov 14, 2021
    Posts:
    56
    Wow that worked, thank you so much!!!!
     
    termway likes this.
  25. myanko

    myanko

    Joined:
    Nov 9, 2013
    Posts:
    56
    termway likes this.
  26. termway

    termway

    Joined:
    Jul 5, 2012
    Posts:
    84
    @myanko

    I added an 'Edit "Unit"' context menu in your tool because I use a lot of custom unit in my project and I don't like to search for files.
    upload_2023-10-13_16-37-26.png

    There might be some modification to do because you cannot really edit the native unit in the VisualScripting package (I have a custom version of VisualScripting so I don't have that problem).
    But an 'Open Unit' menu might still be useful for you.

    upload_2023-10-13_16-36-37.png

    Code (CSharp):
    1. using HarmonyLib;
    2. using UnityEditor;
    3. using System.Reflection;
    4. using System.Linq;
    5. using System.Collections.Generic;
    6. using System;
    7. using UnityEngine;
    8.  
    9. /// <summary>
    10. /// This class is extending the right-click on nodes in the Visual Scripting Window
    11. /// To achieve this, it relies on Harmony to be able to replace the contextOptions
    12. /// getter with my own implementation. I was not able to find another way of doing this...
    13. /// </summary>
    14. namespace Unity.VisualScripting.UVSFinder {
    15.  
    16.     [HarmonyPatch(typeof(IGraphElementWidget))]
    17.     public class UVSGraphElementWidgetExt
    18.     {
    19.         // make sure DoPatching() is called at start either by
    20.         // the mod loader or by your injector
    21.         [InitializeOnLoadMethod]
    22.         public static void DoPatching()
    23.         {
    24.             var harmony = new Harmony("com.sokatoa.patch");
    25.             harmony.PatchAll();
    26.         }
    27.  
    28.         [HarmonyPostfix]
    29.         [HarmonyPatch(typeof(GraphElementWidget<ICanvas, IGraphElement>), "contextOptions", MethodType.Getter)]
    30.         public static IEnumerable<DropdownOption> Postfix1(IEnumerable<DropdownOption> __result, GraphElementWidget<ICanvas, IGraphElement> __instance) {
    31.             // UnitWidget > NodeWidget > GraphElementWidget
    32.             // SuperUnitWidget > NesterUnitWidget > UnitWidget
    33.             var canvasProp = __instance.GetType().GetProperty("canvas", BindingFlags.NonPublic | BindingFlags.Instance);
    34.             ICanvas canvas = (ICanvas)canvasProp.GetValue(__instance);
    35.  
    36.             var elementProp = __instance.GetType().GetProperty("element", BindingFlags.NonPublic | BindingFlags.Instance);
    37.  
    38.             IGraphElement element = (IGraphElement)elementProp?.GetValue(__instance);
    39.  
    40.             // --------------------
    41.             // adding my own options
    42.             var name = "";
    43.             var type = "";
    44.          
    45.             if (__instance is Widget<ICanvas, IGraphElement>)
    46.             {
    47.                 name = GraphElement.GetElementName(__instance.element);
    48.                 type = (__instance as IUnitWidget)?.unit.GetType().ToString();
    49.              
    50.             }
    51.             else if (__instance is IWidget)
    52.             {
    53.                 type = (__instance as IWidget).item.GetType().ToString();
    54.                 name = (__instance as IWidget).item.GetType().HumanName();
    55.             }
    56.  
    57.             // adding the related searches per type
    58.             switch (type)
    59.             {
    60.                 case "Unity.VisualScripting.CustomEvent":
    61.                 case "Bolt.CustomEvent":
    62.                     {
    63.                         var curr = ((__instance as IUnitWidget).unit as CustomEvent);
    64.                         var relatedFindName = $"{curr.defaultValues["name"]} [TriggerCustomEvent]";
    65.                         yield return new DropdownOption((Action)(() => OnFindExact(name)), $"Find \"{name}\" ~");
    66.                         yield return new DropdownOption((Action)(() => OnFindExact(relatedFindName)), $"Find \"{relatedFindName}\"");
    67.                         break;
    68.                     }
    69.                 case "Unity.VisualScripting.TriggerCustomEvent":
    70.                 case "Bolt.TriggerCustomEvent":
    71.                     {
    72.  
    73.                         var curr = ((__instance as IUnitWidget).unit as TriggerCustomEvent);
    74.                         var relatedFindName = $"{curr.defaultValues["name"]} [CustomEvent]";
    75.                         yield return new DropdownOption((Action)(() => OnFindExact(name)), $"Find \"{name}\" ~");
    76.                         yield return new DropdownOption((Action)(() => OnFindExact(relatedFindName)), $"Find \"{relatedFindName}\"");
    77.                         break;
    78.                     }
    79.                 case "Unity.VisualScripting.GetVariable":
    80.                 case "Bolt.GetVariable":
    81.                     {
    82.                         var curr = ((__instance as IUnitWidget).unit as GetVariable);
    83.                         var relatedFindName = $"{curr.defaultValues["name"]} [Set Variable: {curr.kind}]";
    84.                         var relatedFindName2 = $"{curr.defaultValues["name"]} [Has Variable: {curr.kind}]";
    85.                         yield return new DropdownOption((Action)(() => OnFindExact(name)), $"Find \"{name}\" ~");
    86.                         yield return new DropdownOption((Action)(() => OnFindExact(relatedFindName)), $"Find \"{relatedFindName}\"");
    87.                         yield return new DropdownOption((Action)(() => OnFindExact(relatedFindName2)), $"Find \"{relatedFindName2}\"");
    88.                         break;
    89.                     }
    90.                 case "Unity.VisualScripting.SetVariable":
    91.                 case "Bolt.SetVariable":
    92.                     {
    93.                         var curr = ((__instance as IUnitWidget).unit as SetVariable);
    94.                         var relatedFindName = $"{curr.defaultValues["name"]} [Get Variable: {curr.kind}]";
    95.                         var relatedFindName2 = $"{curr.defaultValues["name"]} [Has Variable: {curr.kind}]";
    96.                         yield return new DropdownOption((Action)(() => OnFindExact(relatedFindName)), $"Find \"{relatedFindName}\"");
    97.                         yield return new DropdownOption((Action)(() => OnFindExact(name)), $"Find \"{name}\" ~");
    98.                         yield return new DropdownOption((Action)(() => OnFindExact(relatedFindName2)), $"Find \"{relatedFindName2}\"");
    99.                         break;
    100.                     }
    101.                 case "Unity.VisualScripting.IsVariableDefined":
    102.                 case "Bolt.IsVariableDefined":
    103.                     {
    104.                         var curr = ((__instance as IUnitWidget).unit as IsVariableDefined);
    105.                         var relatedFindName = $"{curr.defaultValues["name"]} [Get Variable: {curr.kind}]";
    106.                         var relatedFindName2 = $"{curr.defaultValues["name"]} [Set Variable: {curr.kind}]";
    107.                         yield return new DropdownOption((Action)(() => OnFindExact(relatedFindName)), $"Find \"{relatedFindName}\"");
    108.                         yield return new DropdownOption((Action)(() => OnFindExact(relatedFindName2)), $"Find \"{relatedFindName2}\"");
    109.                         yield return new DropdownOption((Action)(() => OnFindExact(name)), $"Find \"{name}\" ~");
    110.                         break;
    111.                     }
    112.                 case "Unity.VisualScripting.GetMember":
    113.                     {
    114.                         var curr = ((__instance as IUnitWidget).unit as GetMember);
    115.                         var relatedFindName = $"{curr.member.targetTypeName.Split('.').Last()} Set {curr.member.name}";
    116.                         yield return new DropdownOption((Action)(() => OnFindExact(name)), $"Find \"{name}\" ~");
    117.                         yield return new DropdownOption((Action)(() => OnFindExact(relatedFindName)), $"Find \"{relatedFindName}\"");
    118.                         break;
    119.                     }
    120.                 case "Unity.VisualScripting.SetMember":
    121.                     {
    122.                         var curr = ((__instance as IUnitWidget).unit as SetMember);
    123.                         var relatedFindName = $"{curr.member.targetTypeName.Split('.').Last()} Get {curr.member.name}";
    124.                         yield return new DropdownOption((Action)(() => OnFindExact(relatedFindName)), $"Find \"{relatedFindName}\"");
    125.                         yield return new DropdownOption((Action)(() => OnFindExact(name)), $"Find \"{name}\" ~");
    126.                         break;
    127.                     }
    128.                 default:
    129.                     {
    130.                         if (!String.IsNullOrEmpty(name))
    131.                         {
    132.                             yield return new DropdownOption((Action)(() => OnFind(name)), $"Find \"{name}\"");
    133.                         }
    134.                         break;
    135.                     }
    136.             }
    137.  
    138.             yield return new DropdownOption((Action)(() => OnEditFileType(type)), $"Edit \"{type}\"");
    139.  
    140.             // --------------------
    141.             // This is recreating the list returned by GraphElementWidget's get contextOptions
    142.             var suffix = canvas?.selection.Count > 1 ? " Selection" : "";
    143.  
    144.             if (GraphClipboard.canCopySelection)
    145.             {
    146.                 yield return new DropdownOption((Action)GraphClipboard.CopySelection, "Copy" + suffix);
    147.                 yield return new DropdownOption((Action)GraphClipboard.CutSelection, "Cut" + suffix);
    148.             }
    149.  
    150.             if (GraphClipboard.canDuplicateSelection)
    151.             {
    152.                 yield return new DropdownOption((Action)GraphClipboard.DuplicateSelection, "Duplicate" + suffix);
    153.             }
    154.  
    155.             if (canvas.selection.Count > 0)
    156.             {
    157.                 yield return new DropdownOption((Action)canvas.DeleteSelection, "Delete" + suffix);
    158.             }
    159.  
    160.             if (element != null) // this is fishy that I have to add that and GraphElementWidget doesn't...
    161.             {
    162.                 if (GraphClipboard.CanPasteInside(element))
    163.                 {
    164.                     yield return new DropdownOption((Action)(() => GraphClipboard.PasteInside(element)), "Paste Inside");
    165.                 }
    166.             }
    167.  
    168.             if (GraphClipboard.canPasteOutside)
    169.             {
    170.                 yield return new DropdownOption((Action)(() => GraphClipboard.PasteOutside(true)), "Paste Outside");
    171.             }
    172.  
    173.         }
    174.  
    175.         private static void OnFindExact(string keyword)
    176.         {
    177.             var uvsfinder = UVSFinder.GetUVSFinder();
    178.             uvsfinder.OnSearchAction(keyword, true);
    179.         }
    180.  
    181.         private static void OnFind(string keyword)
    182.         {
    183.             var uvsfinder = UVSFinder.GetUVSFinder();
    184.             uvsfinder.OnSearchAction(keyword, false);
    185.         }
    186.  
    187.         private static void OnEditFileType(string type)
    188.         {
    189.             string[] guids = AssetDatabase.FindAssets("t: script", null);
    190.             string fileName = type.Split('.').Last();
    191.             bool found = false;
    192.             // If multiple matches are found, opens them all.
    193.             foreach (string guid in guids)
    194.             {
    195.                 string path = AssetDatabase.GUIDToAssetPath(guid);
    196.                 if (path.Contains(fileName))
    197.                 {
    198.                     var obj = AssetDatabase.LoadMainAssetAtPath(path);
    199.                     Debug.Log($"Edits '{fileName}' in the file '{path}' ({guid}).");
    200.                     AssetDatabase.OpenAsset(obj);
    201.                     found = true;
    202.                 }
    203.             }
    204.             if(!found)
    205.                 Debug.LogError($"Could not edit '{type}' because it could not be found in scripts file.");
    206.         }
    207.     }
    208. }
    209.  
     
    Last edited: Oct 14, 2023
  27. termway

    termway

    Joined:
    Jul 5, 2012
    Posts:
    84
    Also an useful feature would be to able to see the default input value of the unit.
    For example: a research for a WaitForSeconds unit could show the delay (float) in the red section and if it's unscaled (bool) in the search result.

    upload_2023-10-13_16-58-14.png

    This seems out of my reach at the moment, but I might try it in the future if I have time.
     
    Ignacii, literacy and myanko like this.
  28. myanko

    myanko

    Joined:
    Nov 9, 2013
    Posts:
    56
    Nice, thx for sharing, I will create a task for it to become an official feature and try to find some time, to add it to the next release.
     
    termway and literacy like this.
  29. literacy

    literacy

    Joined:
    Nov 14, 2021
    Posts:
    56
    Would it ever be possible to add a "Find and Replace" feature?

    Maybe for now, it would only replace strings. So I could search for a string "thisUnitName" and replace it with "thatUnitName". Then I could choose to find and replace them all at once.

    Right now, changing names of variables is easy in Visual Studio... but a lot of manual work in Visual Scripting!
     
  30. myanko

    myanko

    Joined:
    Nov 9, 2013
    Posts:
    56
    It is part of the things I would love to do, but haven't got the time to invest on it. I got some pretty ideas how to make the feature, but I will need to scope it down to get something functional and useable first. We need to test the M1 fix and the fix for the errors that you are getting and push this on the asset store.

    I was expecting to possibly add right click actions in the blackboard, to rename vars also. May not be a day one feature, but it is something that could be nice.
     
  31. Trindenberg

    Trindenberg

    Joined:
    Dec 3, 2017
    Posts:
    398
    When I was using VS ages ago, this was a main issue where custom actions are defined with strings. Refactoring would be a great addition. Ideally though, I think any node with a string name could be added to a table somewhere, so not only refactoring, but seeing where everything is, making them more 'scriptable' so to say rather than somewhere out there.
     
    myanko and PanthenEye like this.
  32. artokarsus_unity

    artokarsus_unity

    Joined:
    Mar 18, 2019
    Posts:
    9
    Hi! Just wondering what the status of the Harmony M1,2,3 fix is?
     
  33. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    108
    Hello myanko! Hope you're doing well. I updated to the latest version of Unity LTS 2022 and updated visual scripting to the latest version and the node finder looks for nodes only in the current graph. When looking in all graphs it always shows zero for some reason.
     
  34. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    108
    Ohh it works now. I just had to delete a huge graph imported from my old project. Had some kind of conflicts for some reason
     
  35. Cosisi

    Cosisi

    Joined:
    Sep 14, 2023
    Posts:
    2
    Great work! How to search a node with Scriptable Object as an [UnitHeaderInspectable] variable? Like searching Custom Event.