- Home /
Question by
gumvic · Jan 17, 2014 at 08:14 PM ·
c#script errorsendmessagemessage
SendMessage static parameters checking
Unity is able to check say Component.OnCollisionEnter parameter type at compile time, giving a 'Script error' when it's wrong. How do I do this for my custom messages? I thought there is an attribute like [MessageParameterType(typeof(...))] but I found nothing like that.
Comment
Hi, no. The input parameters are string: as a method name and object as a method parameter(s). So there are no way for compiler to do a type check.
Your answer
![](https://koobas.hobune.stream/wayback/20220613130721im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Multiple Cars not working 1 Answer
Compiler error when using ArraySegment 0 Answers
2D C# Jump Script Addforce 2 Answers
An OS design issue: File types associated with their appropriate programs 1 Answer