private void SetOptions(AnimBool animBool, bool initialize, bool targetValue) { if (initialize) { animBool.value = targetValue; animBool.valueChanged.AddListener(new UnityAction(this.Repaint)); } else { animBool.target = targetValue; } }