错误CS1585:成员修饰符'public'必须位于成员类型和名称之前

时间:2013-12-15 00:55:30

标签: c# unity3d override monodevelop

伙计我正在研究Unity3D的MonoDevelop。我正在实现我的课程,但是我得到了一个错误,我无法弄清楚是什么。我得到的问题是在我覆盖抽象方法的行的标题中继续和isFinished。问题是什么?

namespace tool
{

    public class TaskManager
    {
        public TaskManager ()
        {
        }
    }

    public abstract class Task {
        public bool isEvitable = true;
        public abstract void proceed();
        public abstract bool isFinished();
    }

    public class MoveTask : Task {
        float speed;
        Vector3 targetPosition;
        GameObject movingObject;

        private MoveTask(GameObject gameObject, float speed, Vector3 target) {
            this.movingObject = gameObject;
            this.speed = speed;
            this.targetPosition = target;
        }

        @override
        public void proceed() {
            Vector3 objPos = movingObject.transform.position;
            movingObject.transform.position = new Vector3 (Mathf.Lerp(objPos.x, targetPosition.x, speed),
                                                           Mathf.Lerp(objPos.y, targetPosition.y, speed),
                                                           Mathf.Lerp(objPos.z, targetPosition.z, speed));
        }

        @override
        public bool isFinished() {
        }

    }

}

2 个答案:

答案 0 :(得分:2)

试试这个。你的是java语法。

public override void proceed(){
}

public override bool isFinished(){
    return false;
}

答案 1 :(得分:0)

怎么样?

 public partial class Form1 : Form
    {
        ExploitAPI api ; new ExploitAPI

     public ExploitAPI Api { get => api; set => api = value; }


        public Form1()
        {
            InitializeComponent();
            api.LaunchExploit();
        }

        private void Button1_Click(object sender, EventArgs e)
        {
            api.ToggleClickTeleport();
        }
    }
}

请尽快回答修复

最好的问候,客人