Well, my problem is simple:
If i have a Static method, but i want to get the object which is calling that method
something like:
public class MyClass {
public static void PrintMyName(){
string str = "Hi, my name is: ";
Debug.Log(str+ caller.gameobject.name +"!");
}
}
And in a Object B call that function:
//Object B with name AsDF
gameobject.name="AsDF";
//call function
MyClass.PrintMyName();
this should print in the console:
Hi, my name is AsDF!
but the question is how to get the GameObject which is calling that function?
Thanks for reading!