What I have:
public void New_Click()
{
MenuManager.GoToMenu(MenuName.NewDescr);
StartCoroutine(WaitForClose());
}
IEnumerator WaitForClose()
{
yield return new WaitWhile(MenuManager.MenuOpen);
listMonitor.AddToGrid(Descriptor.List.Last());
yield return null;
}
What I want:
public void New_Click()
{
MenuManager.GoToMenu(MenuName.NewDescr);
WaitForClose(listMonitor.AddToGrid(Descriptor.List.Last()));
}
Basically, I'd like to implement a wrapper around a method call, but not have to specify StartCoroutine() nor write out the WaitForClose() method every time the method is used. I have little experience with delegates and Interfaces - are those the answer? If so, how?