how to check if a function is called unity code example
Example: find out which function called unity
At the top of your class, add this import:
using System.Diagnostics;
Then in your function:
string callingFuncName = new StackFrame(1).GetMethod().Name;