I can’t figure out how to use inspectors that support editing multiple objects while still being compatible with unity 3.4. I’ve made something that actually compiles, but the inspector falls back to default. I have no idea why, because the declaration is there, and it causes the custom inspector to show up when I don’t use a macro.
How do I use [CanEditMultipleObjects] without breaking Unity 3.4 compatibility?
macro declare_my_class:
body = [|
pass
|]
ifdef UNITY_3_4:
yield [|
[CustomEditor(MyClass)]
class MyClassEditor (Editor):
$body
|]
ifdef UNITY_3_5:
yield [|
[CustomEditor(MyClass), CanEditMultipleObjects]
class MyClassEditor (Editor):
$body
|]
declare_my_class true