Make ActiveSetter work even if it is on a disabled game object

Create issue
Issue #21 resolved
Christian Oeing repo owner created an issue

From https://forum.unity3d.com/threads/released-data-bind-for-unity.298471/page-3#post-3010057

"Active Setter is cool, but need to be on a different gameobject of the Target, or else it will never reactivate again. Do you have a workaround ? I would like to have it on the gameobject I want to toggle directly."

Comments (10)

  1. Christian Oeing reporter

    For the ActiveSetter, I guess what could be usefull is to have a checkbox for classes that derives from "SingleSetter", and change this line based on the checkbox:

    protected override void OnDisable()
        {
          base.OnDisable();
          this.Data.ValueChanged -= new DataBinding.ValueChangedDelegate(this.OnObjectValueChanged);
        }
    
  2. ZhaoXiangXML

    Is there a progress on this issue? I just spent half a day on ActiveSetter not working before I realize it's been disabled by itself.

  3. Christian Oeing reporter

    Just added a field called DontDisableOnInactive to the ActiveSetter that makes sure that the ActiveSetter is not disabled even if the game object it is on gets inactive.

    Although I see that it is annoying to step into this trap (and I stepped into it as well in the beginning), I see this field only as a workaround. In general the ActiveSetter should be disabled as well when its game object becomes inactive, so by default the field is false.

    It may still be a good reminder that the ActiveSetter becomes disabled and hopefully devs step less often into this trap.

  4. Log in to comment