Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Assets Essential Editor - Make your test and debugging simple.

Discussion in 'Works In Progress - Archive' started by zsaladin, Sep 12, 2017.

  1. zsaladin

    zsaladin

    Joined:
    Jan 20, 2015
    Posts:
    11
    Unity Asset that exposes properties and methods of MonoBehaviour to inspector. You can expose them to inspector simply by using specific attribute.

    It makes your test and debugging easy. Also it can enhance the encapsulation.


    How to use

    [ExposeMethod]

    The methods using this attribute are exposed in inspector. It invokes the method if you click 'Invoke' button. If the return type is not 'void' then the result will be printed in console window.
    Code (CSharp):
    1. [ExposeMethod]
    2. void Foo()
    3. {
    4.  
    5. }
    6.  
    7. [ExposeMethod]
    8. int Goo()
    9. {
    10.    return 1;
    11. }
    12.  
    13. [ExposeMethod]
    14. string Hoo(int x, float y, Vector3 z, string w)
    15. {
    16.    return w;
    17. }


    [ExposeProperty]
    The properties using this attribute are exposed in inspector.
    Code (CSharp):
    1. [ExposeProperty]
    2. public float Foo
    3. {
    4.    get { return foo; }
    5.    set { foo = value; }
    6. }
    7.  
    8. [ExposeProperty]
    9. public float Goo
    10. {
    11.    get { return foo; }
    12. }
    13.  
    14. [ExposeProperty]
    15. public Vector3 Hoo
    16. {
    17.    get;
    18.    set;
    19. }


    link : https://github.com/zsaladin/EssentialEditor