7 comments on “Custom Editors in Unity3D 3.5 – C# Example

  1. Hi,
    First of all, thank you for theses posts. It helped me a lot.

    Then, I’m some kind of code newbie so i’m really sorry if I am about to ask something stupid. 🙂
    I think I don’t get how serialized object work. I see you never “construct” your object. Is it implicitly created?
    And let’s say the MyScript class have a method that write into the console. How do you access it through your custom inspector?

    Thanks
    PS: excuse my english, I’m not only a code newbie. I am a french code newbie ^^

    • Hi,

      Great to hear this post has been of some use 🙂

      serializedObject is inherited from Editor, and is handled by Unity so you don’t need to instantiate it or anything. If you want a more in-depth understanding of what’s going on, I would recommend looking at the script reference for Editor – it talks about serializedObject in one of the early paragraphs and uses it in most of the examples. It also links through to the script reference for SerializedObject class.

      Sorry for the slow response – I’ve been checking out some node.js and haskell the last week and been a bit caught up in that.

      P.S. Don’t worry about the English – my day job is making translation software so I interact with plenty of people for whom English is not a primary language. Also your English is a lot better than my French 🙂

  2. Hi,
    Thanks for your answer. I did find some good informations in the script reference. But it seems a lot is over my understanding 🙂

    regards

  3. So this way completely bypasses the getter/setter and modifies the private int, right?

    Would using change check and then assigning the MyValue property to the resulting valueProperty.intValue be a good method?

    Is there a better way to make sure the property setter gets called?

  4. Pretty great post. I just stumbled upon your blog and wanted to
    mention that I have truly enjoyed browsing your weblog posts.
    After all I will be subscribing in your rss feed and I’m hoping you write again soon!

Leave a Reply

Your email address will not be published. Required fields are marked *