ConditionalAttribute
Have been looking for this C# attribute for a while. In Chronicle (our timeline log tool), i've wanted an easy way to ensure that all calls to it can be removed and ensure no GC or CPU is being used, without having to decorate every call with #IF UNITY_EDITOR
or some ugly horrible construction like that. And so we get [Conditional("")]
, which i can just put on top of all the Log()
methods. Sweet!
Oh Unity3d, why do you pain me so
An interesting bug when using Unity Events... You have created a class with a method like public void MyMethod()
, and have a unity event which targets that method. You later decide that the method should be private
rather than public
. The unity event does not care about the access change, and happily continues to call your, now private, method. Also, it can be very difficult to find what unity event is actually calling your method, making tracking down this kind bug very difficult. A "fix" is to change the name of the method, thus breaking the unity event reference. But that is not ideal. I do not have a solution, other than that the unity events should respect the access modifiers on the methods they are calling. With the knowledge that that would likely be run-time costly, and so maybe not worth it.