Using the dotween library for Unity: http://dotween.demigiant.com/documentation.php
And being rusty on C#...
Is there a way to specify a function inline as parameter to .OnComplete for instance, so that we don't have to chop up a sequence of actions in separate functions?
Ie I'd like to use the feature known as blocks in ObjC, but in C#.
Long-winded an unintuitive way:
void myCallback () {
// do more stuff here
}
void mysequence() {
transform.DOMoveX(4, 1).OnComplete(myCallback);
}
What I want to do which is easier to read and keeps stuff in place:
void mysequence() {
transform.DOMoveX(4, 1).OnComplete({
// do more stuff here
});
}
The way C# does this is with lambdas:
From the documentation you linked to: