error CS0115: 'LootContainerInteract.Interact(Character)': no suitable method found to override
时间: 2024-05-15 19:15:39 浏览: 19
This error occurs when a method in a subclass is trying to override a method in the parent class, but the method signature does not match exactly. In this case, the subclass "LootContainerInteract" is trying to override a method called "Interact" in the parent class, but the method signature does not match.
To fix this error, you need to check the method signature in the parent class and make sure that the signature of the method in the subclass matches it exactly. This includes the method name, return type, and parameters.
You may also need to check if the parent class is marked as "virtual" or "abstract." If it is not marked as such, you cannot override its methods.
Here is an example of a correct method signature override:
```
public override void Interact(Character character)
{
// Implementation here
}
```
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)