public T ExecuteInMainThread <T>(Future <T> fn, ExecutionOrder order = ExecutionOrder.Any) { if (InUnityThread()) { return(fn.Invoke()); } T val = default(T); ExecuteInMainThread(() => { val = fn.Invoke(); }, order); return(val); }