diff --git a/Assets/EasyButtons/Editor/Button.cs b/Assets/EasyButtons/Editor/Button.cs index 645c8c1..55e200d 100644 --- a/Assets/EasyButtons/Editor/Button.cs +++ b/Assets/EasyButtons/Editor/Button.cs @@ -4,6 +4,7 @@ using JetBrains.Annotations; using UnityEditor; using Utils; + using System.Collections.Generic; /// /// A class that holds information about a button and can draw it in the inspector. @@ -36,7 +37,7 @@ protected Button(MethodInfo method, ButtonAttribute buttonAttribute) _disabled = ! (buttonAttribute.Mode == ButtonMode.AlwaysEnabled || inAppropriateMode); } - public void Draw(object[] targets) + public void Draw(IEnumerable targets) { using (new EditorGUI.DisabledScope(_disabled)) { @@ -63,6 +64,6 @@ internal static Button Create(MethodInfo method, ButtonAttribute buttonAttribute } } - protected abstract void DrawInternal(object[] targets); + protected abstract void DrawInternal(IEnumerable targets); } } \ No newline at end of file diff --git a/Assets/EasyButtons/Editor/ButtonWithParams.cs b/Assets/EasyButtons/Editor/ButtonWithParams.cs index e9ecb35..00c1f0b 100644 --- a/Assets/EasyButtons/Editor/ButtonWithParams.cs +++ b/Assets/EasyButtons/Editor/ButtonWithParams.cs @@ -7,6 +7,7 @@ using UnityEngine; using Utils; using Object = UnityEngine.Object; + using System.Collections.Generic; internal class ButtonWithParams : Button { @@ -20,7 +21,7 @@ public ButtonWithParams(MethodInfo method, ButtonAttribute buttonAttribute, Para _expanded = buttonAttribute.Expanded; } - protected override void DrawInternal(object[] targets) + protected override void DrawInternal(IEnumerable targets) { (Rect foldoutRect, Rect buttonRect) = DrawUtility.GetFoldoutAndButtonRects(DisplayName); diff --git a/Assets/EasyButtons/Editor/ButtonWithoutParams.cs b/Assets/EasyButtons/Editor/ButtonWithoutParams.cs index 5baa485..6326dc3 100644 --- a/Assets/EasyButtons/Editor/ButtonWithoutParams.cs +++ b/Assets/EasyButtons/Editor/ButtonWithoutParams.cs @@ -2,13 +2,14 @@ { using System.Reflection; using UnityEngine; + using System.Collections.Generic; internal class ButtonWithoutParams : Button { public ButtonWithoutParams(MethodInfo method, ButtonAttribute buttonAttribute) : base(method, buttonAttribute) { } - protected override void DrawInternal(object[] targets) + protected override void DrawInternal(IEnumerable targets) { if ( ! GUILayout.Button(DisplayName)) return; diff --git a/Assets/EasyButtons/Editor/ButtonsDrawer.cs b/Assets/EasyButtons/Editor/ButtonsDrawer.cs index 8bb2f1b..dbfd2e3 100644 --- a/Assets/EasyButtons/Editor/ButtonsDrawer.cs +++ b/Assets/EasyButtons/Editor/ButtonsDrawer.cs @@ -40,7 +40,7 @@ public ButtonsDrawer(object target) /// /// Draws all the methods marked with . /// - public void DrawButtons(object[] targets) + public void DrawButtons(IEnumerable targets) { foreach (Button button in Buttons) {