Don't use SendMessage() or BroadcastMessage(), they are extremely slow and very painful to debug because you pass in a string. They are seldom used for quick prototyping to get something up and running but not ideal for a game release.
-
Instead, grab a reference to the script/component that holds the method you wish to call and use that reference to call whatever method you need from the script/component. `scriptRef.MethodToCall(); `
-
Use an event or delegate if you need to call multiple scripts at once to access a method...
↧