diff --git a/Runtime/InteractiveComponent.cs b/Runtime/InteractiveComponent.cs index f46dc39..d30c3c3 100644 --- a/Runtime/InteractiveComponent.cs +++ b/Runtime/InteractiveComponent.cs @@ -97,6 +97,7 @@ public static InteractiveComponent CreateInteractableComponent(MonoBehaviour com /// The function returns the Component is interactable or not. /// Default is DefaultComponentInteractableStrategy.IsInteractable. /// Returns new InteractableComponent instance from GameObject. If GameObject is not interactable so, return null. + [Obsolete("Obsolete due to non-deterministic behavior when GameObject has multiple interactable components.")] public static InteractiveComponent CreateInteractableComponent(GameObject gameObject, Func getScreenPoint = null, Func, PointerEventData, List, bool> isReachable = null, diff --git a/Samples~/uGUI Demo/Tests/Runtime/ScenarioTest.cs b/Samples~/uGUI Demo/Tests/Runtime/ScenarioTest.cs index 3aba08a..8c463d3 100644 --- a/Samples~/uGUI Demo/Tests/Runtime/ScenarioTest.cs +++ b/Samples~/uGUI Demo/Tests/Runtime/ScenarioTest.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using NUnit.Framework; using TestHelper.Attributes; +using UnityEngine.UI; namespace TestHelper.Monkey.Samples.UGUIDemo { @@ -25,17 +26,23 @@ public async Task OpenSubScreens(string target) // When click Start button, then open Home screen. var startButton = await _finder.FindByNameAsync("StartButton", interactable: true); - InteractiveComponent.CreateInteractableComponent(startButton).Click(); + var startComponent = InteractiveComponent.CreateInteractableComponent(startButton.GetComponent