【发布时间】:2019-08-24 09:07:12
【问题描述】:
我记得默认情况下接口是公共的。我错了吗?当我尝试从接口实现“公共静态”方法时。 VS 告诉我,接口中的方法比“公共静态”方法更难访问。当我将公共添加到界面时,它已修复。接口默认不公开吗?
interface IDoubleFloatEventInvoker {
void AddListener(EventName eventName, UnityAction<float, float> unityAction);
}
public static void AddInvoker(EventName eventName, IDoubleFloatEventInvoker invoker)
{
foreach (UnityAction<float, float> listener in doubleFloatListeners[eventName])
{
invoker.AddListener(eventName, listener);
}
doubleFloatInvokers[eventName].Add(invoker);
}
“VS 说 IDoubleFloatEventInvoker 比 AddInvoker 函数更难访问”
【问题讨论】:
标签: c# interface static access-modifiers