-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
实现两个接口同名函数 #679
Labels
Comments
运行环境和ILRuntime版本分别是什么? |
unity 2020.3.29f1 |
public static class Main
{
public static void Test()
{
InterfaceUnit interfaceUnit = new InterfaceUnit();
ITest test = interfaceUnit as ITest;
test.Test();
}
}
public interface ITest
{
public void Test()
{
Debug.Log("InterfaceUnit");
}
}
public class InterfaceUnit : ITest
{
void Test()
{
Debug.Log("InterfaceUnit");
}
}
public static class Main
{
public static void Test()
{
InterfaceUnit interfaceUnit = new InterfaceUnit();
ITest test = interfaceUnit as ITest;
test.Test();
}
}
public interface ITest
{
public void Test()
{
Debug.Log("InterfaceUnit");
}
}
public class InterfaceUnit : ITest
{
// public void Test()
// {
// Debug.Log("InterfaceUnit");
// }
}
public static class Main
{
public static void Test()
{
InterfaceUnit interfaceUnit = new InterfaceUnit();
ITest test = interfaceUnit as ITest;
test.Test();
}
}
public interface ITest
{
public void Test()
{
Debug.Log("InterfaceUnit");
}
}
public class InterfaceUnit : ITest
{
void ITest.Test()
{
Debug.Log("InterfaceUnit");
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NullReferenceException: Object reference not set to an instance of an object.
Without useful stack information.
The text was updated successfully, but these errors were encountered: