dam*_*les 1 c# extension-methods
是否可以在静态扩展方法中修改this/focus变量?
例如:
public static class AnimExtensions
{
public static int anim(this float f, float to, float time)
{
return Animation.Start(a => f = a, f, to, time);
}
}
Run Code Online (Sandbox Code Playgroud)
我想通过在'this'变量上使用lambda函数来调用使用float的扩展的Animation.Start方法.扩展方法中不允许使用this关键字,但是有另一种方式以这种方式访问/使用变量吗?