Siccity / SerializableCallback

UnityEvent and System.Func had a child
MIT License
359 stars 53 forks source link

Inspector does not show SerializableCallback property #15

Closed alfiolocastro closed 4 years ago

alfiolocastro commented 4 years ago

Inspector does not show SerializableCallback property (Unity 2019.3.10)

Example given:

`public class SliderDefaultValue : MonoBehaviour {

public SerializableCallback<float> getter; // this is not shown on the inspector
public Slider mSlider;

void Start()
{
    if (getter != null)
        mSlider.value = getter.Invoke();
}

void Update()
{

}

}`

Siccity commented 4 years ago

You need to create a wrapper class for Unity to serialize it. There is an example of how to use it in the readme.

alfiolocastro commented 4 years ago

yep, you're right stupid me!