I have attached an Onclick Event trigger on a Gameobject (A) , which calls a function of a script, which is attached to a different GameObject (B). In this function, I need to get the object that has the OnClick trigger (A) . Is it possible to implement this in Unity without making reference variables to A in B’s script?
You either make a reference on script B to A, or on the GameObjectA trigger sends a parameter reference to itself so on the function in B it receives the trigger with a parameter with the reference to A.