As Andrei said, I believe that Unity accesses these methods using a naming convention and signature, rather than using a compile time identifier.
What you can do is define an interface that represents these methods:
public interface IStart { void Start(); } public interface IUpdate { void Update(); }
Then in your script classes, you can inherit from the interfaces you are going to implement:
public class MyScript : MonoBehaviour, IStart, IUpdate { public void Start() { } public void Update() { } }
The disadvantage is that these methods become public . I have never tried, but I assume that Unity will support these methods, implemented using an explicit interface implementation , which can help hide these method calls from the regular API access:
public class MyScript : MonoBehaviour, IStart, IUpdate { void IStart.Start() { } void IUpdate.Update() { } }
After you have this, if you seal the method signature, you will get a compiler error.
As an added bonus, I don't know if MonoDevelop has this parameter, but in Visual Studio, when you add interface inheritance to the class declaration, you get a context parameter so that Visual Studio automatically implements the interface method signatures (implicitly or explicitly).
source share