What you have up there is the real gist of it. you can use pretty much anything, i only know of a few exceptions. You could use public functions, private functions, variables, unity methods, your own methods, if statements, while loops, for loops, Unity variables, declare variables, change variables, instantiate, destroy, move, alter, and more!
OnTriggerEnter is what we call a generic functions,
http://docs.unity3d.com/Documentation/Manual/GenericFunctions.html
generic functions are unity built in things shall we say, they are run the code in there brackets when a certain thing happens in your game that would be hard to detect through just plain old codeing.
remember when i said there were a few exceptions, well you coroutines can get a little dodgy with some of the functions, and you cannot use a generic function within another generic function.
I’m sure that there are lots more exceptions but i can’t think of anymore off the top of my head.
For an example of its usage, lets say you have a sword. You might use OnTriggerEnter() to tell when the sword has hit something.
The short answer is : Practically Anything.
hope this answered you question,
Quishtay™ all the way
Thanks, this really helped me a lot.
– ICHeeryIno problem. Always happy to help
– rednax20