呼叫功能有什么错误?

Naw*_*waf 1 c# function

我试图在Unity环境中调用一个用c#编写的示例函数.我收到此错误消息:

多成员名称不能与其封闭类型相同

这是我正在使用的代码:

using UnityEngine;
using System.Collections;

public class multi : MonoBehaviour {
    // Use this for initialization
    void Start () {

    }

    // Update is called once per frame
    void Update () {
        int x = 5;
        multi (x);
    }

    int multi ( int tem ){
        int ret ;
        ret = tem * 2 ; 
        return ret;
    }
}
Run Code Online (Sandbox Code Playgroud)

Bat*_*eba 10

除非函数是构造函数,否则函数名称不能与类名相同.


Sme*_*egs 6

除非是构造函数,否则在名为"multi"的类中不能有"multi"函数.