OK. I have been on this website: Unity - Scripting API: MonoBehaviour but there are a lot of methods. Please could you give me a list of main methods used in unity? I have learnt to use C#. I can write custom classes, methods; I understand inheritance, objects and their types etc…
You can’r really “learn a method”. All you need to know what a method is doing and which callbacks (overridable methods) are called in which situations. Just take the time and browse through them. The detailed description explain 95% what you have to know.
For example OnBecameVisible: The description clearly explains that this callback is invoked by a Renderer component. Almost all callbacks belong to a certain component. MonoBehaviour has some that belong to itself (since MonoBehaviour is also a component).
Here i grouped them into a more logical order:
MonoBehaviour itself
Update, LateUpdate, FixedUpdate, Awake, Start, Reset
OnApplicationPause, OnApplicationFocus, OnApplicationQuit
OnLevelWasLoaded, OnEnable, OnDisable, OnDestroy
OnGUI
Send by Collider
OnMouseEnter,OnMouseOver,OnMouseExit,OnMouseDown,OnMouseUp,OnMouseUpAsButton,OnMouseDrag
Send by Rigidbody for “isTrigger”-collider
OnTriggerEnter,OnTriggerExit,OnTriggerStay
Send by Rigidbody for normal collider
OnCollisionEnter,OnCollisionExit,OnCollisionStay
Send by CharacterController
OnControllerColliderHit
Send by Physx joint component
OnJointBreak
Send by ParticleCollider
OnParticleCollision
Send by Renderer
OnBecameVisible, OnBecameInvisible
Send by Camera
OnPreCull, OnPreRender, OnPostRender, OnRenderObject, OnWillRenderObject, OnRenderImage
Only in Editor
OnDrawGizmosSelected,OnDrawGizmos
Send when using Networking
OnPlayerConnected, OnServerInitialized, OnConnectedToServer, OnPlayerDisconnected,
OnDisconnectedFromServer, OnFailedToConnect
Send when using MasterServer
OnFailedToConnectToMasterServer, OnMasterServerEvent
Send by NetworkView components
OnNetworkInstantiate, OnSerializeNetworkView
Send by AudioSource components
OnAudioFilterRead
You should know them all, or at least be aware of them. It’s not expected that you should memorize the entire API (you can always just look stuff up in the docs for exact usage when needed), but you should know what’s available so you don’t waste time reinventing the wheel.