gmhevinci / MotionFramework

MotionFramework is unity3d game framework.
MIT License
621 stars 116 forks source link

IBuildTask.Run的目的是为了强调此函数是这个接口的一种实现么? #9

Closed lexnewgate closed 2 years ago

lexnewgate commented 2 years ago

https://github.com/gmhevinci/MotionFramework/blob/5a626d792256bf30b94fab605e5ebb56bd89fc09/Assets/MotionFramework/Scripts/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding.cs#L18

一般这种写法好像是用于原继承链和接口不匹配? 这里只是为了强调函数是属于此接口的一种实现么? 还是有别的什么隐藏含义在啊?

gmhevinci commented 2 years ago

没有特别的隐藏含义,只是为了方便每个节点可以很方便的获取到上下文内容,而不用通过单例类去获取。

lexnewgate commented 2 years ago

我的意思是 写成 void IBuildTask.Run(BuildContext context) => 一般这种写法是用于 一个类内包含多个接口 而不是直接void Run(BuildContext context)的原因?

是后续考虑多个接口实现还是单纯想强调这个函数是从属于哪个接口的?

gmhevinci commented 2 years ago

只是单纯想强调这个函数是从属于哪个接口。不过2种写法都可以。