LTDescrOptional.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. //namespace DentedPixel{
  2. using UnityEngine;
  3. using System;
  4. using System.Collections;
  5. using System.Collections.Generic;
  6. public class LTDescrOptional {
  7. public Transform toTrans { get; set; }
  8. public Vector3 point { get; set; }
  9. public Vector3 axis { get; set; }
  10. public float lastVal{ get; set; }
  11. public Quaternion origRotation { get; set; }
  12. public LTBezierPath path { get; set; }
  13. public LTSpline spline { get; set; }
  14. public AnimationCurve animationCurve;
  15. public int initFrameCount;
  16. public Color color;
  17. public LTRect ltRect { get; set; } // maybe get rid of this eventually
  18. public Action<float> onUpdateFloat { get; set; }
  19. public Action<float,float> onUpdateFloatRatio { get; set; }
  20. public Action<float,object> onUpdateFloatObject { get; set; }
  21. public Action<Vector2> onUpdateVector2 { get; set; }
  22. public Action<Vector3> onUpdateVector3 { get; set; }
  23. public Action<Vector3,object> onUpdateVector3Object { get; set; }
  24. public Action<Color> onUpdateColor { get; set; }
  25. public Action<Color,object> onUpdateColorObject { get; set; }
  26. public Action onComplete { get; set; }
  27. public Action<object> onCompleteObject { get; set; }
  28. public object onCompleteParam { get; set; }
  29. public object onUpdateParam { get; set; }
  30. public Action onStart { get; set; }
  31. // #if !UNITY_3_5 && !UNITY_4_0 && !UNITY_4_0_1 && !UNITY_4_1 && !UNITY_4_2
  32. // public SpriteRenderer spriteRen { get; set; }
  33. // #endif
  34. //
  35. // #if LEANTWEEN_1
  36. // public Hashtable optional;
  37. // #endif
  38. // #if !UNITY_3_5 && !UNITY_4_0 && !UNITY_4_0_1 && !UNITY_4_1 && !UNITY_4_2 && !UNITY_4_3 && !UNITY_4_5
  39. // public RectTransform rectTransform;
  40. // public UnityEngine.UI.Text uiText;
  41. // public UnityEngine.UI.Image uiImage;
  42. // public UnityEngine.Sprite[] sprites;
  43. // #endif
  44. public void reset(){
  45. animationCurve = null;
  46. this.onUpdateFloat = null;
  47. this.onUpdateFloatRatio = null;
  48. this.onUpdateVector2 = null;
  49. this.onUpdateVector3 = null;
  50. this.onUpdateFloatObject = null;
  51. this.onUpdateVector3Object = null;
  52. this.onUpdateColor = null;
  53. this.onComplete = null;
  54. this.onCompleteObject = null;
  55. this.onCompleteParam = null;
  56. this.onStart = null;
  57. this.point = Vector3.zero;
  58. this.initFrameCount = 0;
  59. }
  60. public void callOnUpdate( float val, float ratioPassed){
  61. if(this.onUpdateFloat!=null)
  62. this.onUpdateFloat(val);
  63. if (this.onUpdateFloatRatio != null){
  64. this.onUpdateFloatRatio(val,ratioPassed);
  65. }else if(this.onUpdateFloatObject!=null){
  66. this.onUpdateFloatObject(val, this.onUpdateParam);
  67. }else if(this.onUpdateVector3Object!=null){
  68. this.onUpdateVector3Object(LTDescr.newVect, this.onUpdateParam);
  69. }else if(this.onUpdateVector3!=null){
  70. this.onUpdateVector3(LTDescr.newVect);
  71. }else if(this.onUpdateVector2!=null){
  72. this.onUpdateVector2(new Vector2(LTDescr.newVect.x,LTDescr.newVect.y));
  73. }
  74. }
  75. }
  76. //}