From 4532dd6984ad76ed9b4ea0d1458be943307b6b7f Mon Sep 17 00:00:00 2001 From: Hasan Bayat Date: Fri, 4 Oct 2024 11:49:26 +0330 Subject: [PATCH 01/24] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7f51b0..f185093 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Feel free to [:postbox: Post your ideas/comments/improvements/recommendations](h ## Credits - [UnityCoder (mika)](https://github.com/unitycoder) (Owner) -- [EmpireWorld (Hasan Bayat)](https://github.com/EmpireWorld) (Owner) +- [hasanbayatme (Hasan Bayat)](https://github.com/hasanbayatme) (Owner) - [Lootheo (Manuel Otheo)](https://github.com/Lootheo) (Member) - [igorrafael (Igor Rafael de Sousa)](https://github.com/igorrafael) (Member) - [nrlnd](https://github.com/nrlnd) (Member) From 3e2d55b01d812be62b5239fc8f2d4c3b3edd2a2b Mon Sep 17 00:00:00 2001 From: mika Date: Tue, 22 Oct 2024 21:46:37 +0300 Subject: [PATCH 02/24] Create FindWhatButtonCallsMyMethod.cs --- .../Tools/FindWhatButtonCallsMyMethod.cs | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 Assets/Scripts/Editor/Tools/FindWhatButtonCallsMyMethod.cs diff --git a/Assets/Scripts/Editor/Tools/FindWhatButtonCallsMyMethod.cs b/Assets/Scripts/Editor/Tools/FindWhatButtonCallsMyMethod.cs new file mode 100644 index 0000000..e67f45b --- /dev/null +++ b/Assets/Scripts/Editor/Tools/FindWhatButtonCallsMyMethod.cs @@ -0,0 +1,69 @@ +// prints out which buttons in current scene are referencing your given method + +using UnityEngine; +using UnityEngine.UI; +using UnityEditor; +using UnityEngine.Events; +using System.Reflection; + +namespace UnityLibrary +{ + public class FindWhatButtonCallsMyMethod : EditorWindow + { + private string methodName = "MyMethodHere"; + + [MenuItem("Tools/Find Buttons with Method")] + public static void ShowWindow() + { + GetWindow("FindWhatButtonCallsMyMethod"); + } + + private void OnGUI() + { + GUILayout.Label("Find Buttons that call Method", EditorStyles.boldLabel); + methodName = EditorGUILayout.TextField("Method Name:", methodName); + + if (GUILayout.Button("Find Buttons")) + { + FindButtonsWithMethod(); + } + } + + private void FindButtonsWithMethod() + { + Button[] allButtons = FindObjectsOfType