Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

42 rader
951 B

  1. using System;
  2. using UnityEngine;
  3. namespace Tweening
  4. {
  5. public sealed class MonoBehaviourToggleTweenerTrack : TweenerTrack<MonoBehaviour, bool>
  6. {
  7. public override void UpdateComponentValue(float evaluatedTime)
  8. {
  9. bool flag = Mathf.Approximately(Mathf.LerpUnclamped((!this._from) ? 0f : 1f, (!this._to) ? 0f : 1f, evaluatedTime), 1f);
  10. if (this._component.enabled != flag)
  11. {
  12. this._component.enabled = flag;
  13. }
  14. }
  15. public override void ResetComponentValue()
  16. {
  17. if (this._dynamicFrom)
  18. {
  19. this._from = this._component.enabled;
  20. }
  21. else if (this._component.enabled != this._from)
  22. {
  23. this._component.enabled = this._from;
  24. }
  25. }
  26. public override void InitializeComponentValue()
  27. {
  28. if (this._dynamicFrom)
  29. {
  30. this._from = this._component.enabled;
  31. }
  32. else if (this._component.enabled != this._from)
  33. {
  34. this._component.enabled = this._from;
  35. }
  36. }
  37. }
  38. }