我记得默认情况下该接口是公共的。我错了吗?当我尝试从接口实现“公共静态”方法时。VS告诉我,该接口中的方法比“公共静态”方法更难访问。当我将public添加到接口时,它已修复。默认情况下,接口不是公开的吗?
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);
}
Run Code Online (Sandbox Code Playgroud)
“ VS说IDoubleFloatEventInvoker比AddInvoker函数更难访问”