![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | ondesic |
Currently I have 2 scripts. Main.cs and Test.cs.
In the Main.cs there is a function:
ShowInput()
I want to call that function from the Test.cs.
The Node setup is:
Main (has Main.cs which contains the ShowInput() function)
-----Panel
----------Button (has Test.cs)
From the Test.cs script, I am accessing the ShowInput() function like this:
GetParent().GetParent().Call("ShowInput");
This works, but it very tedious. Is there a better way?