- Home /
Question by
falconfetus8 · Jul 23, 2013 at 03:35 PM ·
string
Is it a good idea to modify a "SendMessage" string during runtime?
Take this code as an example:
string[] animationNames = new string[]{"Punch", "Kick", "Bite"};
for (int i = 0; i < names.length; i++){
transform.BroadcastMessage("On" + animationNames[i] + "AnimationEnd");
}
I already know that this is possible, but is it good practice? Are there any kind of potential security vulnerabilities or unforeseen consequences that could result from this?
Comment
Answer by BimSekai · Jul 23, 2013 at 03:40 PM
I would say it is harmless, however it may be a bit more difficult to modify later if you feel the need to.
Your answer
Follow this Question
Related Questions
How to tell if a string contains some specified text 6 Answers
Enemy spawner help with lengths 0 Answers
Return name of file only 1 Answer
Convert Array to String 3 Answers
String comparison, can't use false result as string. 4 Answers