How to use AsyncOperation.completed?

Hello

I want to use the AsyncOperation.completed delegate but there’s not much information about it online, and I’m a bit new to Actions in c#

Can somebody explain to me how to implement it in code?

Actions are great, i personally use them a lot for my projects.

when an action is declared Action<AsyncOperation> the type within the angled brackets is the return type of the action. So there are two ways for you to use this.


###1. Lambda Operation###

AsyncOperation operation = new AsyncOperation();
operation.completed += (asyncOperation) =>
{
	//Do stuff here with returned value asyncOperation
};

###2. Function###

void Test()
{
	AsyncOperation operation = new AsyncOperation();
	
	operation.completed += OperationOnCompleted;
	
}
private void OperationOnCompleted(AsyncOperation obj)
{
	throw new NotImplementedException();
}