Variables not showing on inspector when I extend Unity UI button. I wanted to add some extra functionality to unity button, and to do this i just extaned this button and wanted to have 2 fields. But noticed that those fields are not available in unity inspector, unless i change to debug Code:
public class PlayPauseButton : Button
{
[SerializeField] private Image playGraphic;
[SerializeField] private Image pauseGraphic;
private bool _isPlaying;
}
I was expecting to see the variables on inspector, on normal mode. I can view them on debug but it can be a bit tricky



Try to make folder named 'Editor' on Assets and PlayPauseButton Script into Editor folder! :D
I got hint in https://niclasgleesborg.home.blog/2019/05/23/extend-ui-button-behaviour-in-unity-and-create-a-custom-inspector/