Add static function with arguments support for OnInspectorGUI and CustomAdd

Issue #339 open
Anonymous created an issue

Below, in Foo and Bar, I end up having to define the function locally again and again, even if it's doing the exact same thing I'd much rather do it once in one place and not add boiler plate code every time I need the same List<T> with the same custom add behaviour same goes for OnInspectorGUI.

public class Foo
{
    [ListDrawerSettings(CustomAddFunction = "Func")]
    List<T> list;

    void Func()
    {

    }
}

public class Bar
{
    [ListDrawerSettings(CustomAddFunction = "Func")]
    List<T> list;

    void Func()
    {

    }
}

public class Ideal_Use_Case
{
    [ListDrawerSettings(CustomAddFunction = "Ideal_Use_Case.Func($list)")]
    List<T> list;

    //
    public static void Func(List<T> arg)
    {

    }
}

public class Elsewhere
{
    [ListDrawerSettings(CustomAddFunction = "Ideal_Use_Case.Func($list)")]
    List<T> list;
}

Comments (1)

  1. Log in to comment