using System; using UnityEngine; namespace Tweening { public sealed class MonoBehaviourToggleTweenerTrack : TweenerTrack { public override void UpdateComponentValue(float evaluatedTime) { bool flag = Mathf.Approximately(Mathf.LerpUnclamped((!this._from) ? 0f : 1f, (!this._to) ? 0f : 1f, evaluatedTime), 1f); if (this._component.enabled != flag) { this._component.enabled = flag; } } public override void ResetComponentValue() { if (this._dynamicFrom) { this._from = this._component.enabled; } else if (this._component.enabled != this._from) { this._component.enabled = this._from; } } public override void InitializeComponentValue() { if (this._dynamicFrom) { this._from = this._component.enabled; } else if (this._component.enabled != this._from) { this._component.enabled = this._from; } } } }