How to use CallComponentMethod for a method in the object's attached script?

8 views
Skip to first unread message

Zinc Potassium

unread,
Aug 21, 2022, 3:52:06 AM8/21/22
to AltUnity - UI test automation tool for Unity3D
For a button with a script attached to it, how could I call the method that is written in this script?

Eg. The attached script of a button object "Create" below:

var Create = altUnityDriver.FindObject(By.NAME, "Create", enabled:false);
public class ButtonOperation : MonoBehaviour
{
    public void GetActive(bool active){...}
}

The code:
var active = Create.CallComponentMethod<bool>(" ButtonOperation   ", "GetActive", new[] {""});

won't work. How can I solve that?
Reply all
Reply to author
Forward
0 new messages