public void OnDemandToggled(bool isOn) { if (canvasDelegate == null) { return; } CanvasEditSound.AnimateToggle(onDemandToggle, isOn, animDuration: gameObject.activeInHierarchy ? 0.36f : 0); // Animate }