You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.7 KiB

7 years ago
  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 LTRect ltRect { get; set; } // maybe get rid of this eventually
  17. public Action<float> onUpdateFloat { get; set; }
  18. public Action<float,float> onUpdateFloatRatio { get; set; }
  19. public Action<float,object> onUpdateFloatObject { get; set; }
  20. public Action<Vector2> onUpdateVector2 { get; set; }
  21. public Action<Vector3> onUpdateVector3 { get; set; }
  22. public Action<Vector3,object> onUpdateVector3Object { get; set; }
  23. public Action<Color> onUpdateColor { get; set; }
  24. public Action<Color,object> onUpdateColorObject { get; set; }
  25. public Action onComplete { get; set; }
  26. public Action<object> onCompleteObject { get; set; }
  27. public object onCompleteParam { get; set; }
  28. public object onUpdateParam { get; set; }
  29. public Action onStart { get; set; }
  30. // #if !UNITY_3_5 && !UNITY_4_0 && !UNITY_4_0_1 && !UNITY_4_1 && !UNITY_4_2
  31. // public SpriteRenderer spriteRen { get; set; }
  32. // #endif
  33. //
  34. // #if LEANTWEEN_1
  35. // public Hashtable optional;
  36. // #endif
  37. // #if !UNITY_3_5 && !UNITY_4_0 && !UNITY_4_0_1 && !UNITY_4_1 && !UNITY_4_2 && !UNITY_4_3 && !UNITY_4_5
  38. // public RectTransform rectTransform;
  39. // public UnityEngine.UI.Text uiText;
  40. // public UnityEngine.UI.Image uiImage;
  41. // public UnityEngine.Sprite[] sprites;
  42. // #endif
  43. public void reset(){
  44. animationCurve = null;
  45. this.onUpdateFloat = null;
  46. this.onUpdateFloatRatio = null;
  47. this.onUpdateVector2 = null;
  48. this.onUpdateVector3 = null;
  49. this.onUpdateFloatObject = null;
  50. this.onUpdateVector3Object = null;
  51. this.onUpdateColor = null;
  52. this.onComplete = null;
  53. this.onCompleteObject = null;
  54. this.onCompleteParam = null;
  55. this.onStart = null;
  56. this.point = Vector3.zero;
  57. this.initFrameCount = 0;
  58. }
  59. public void callOnUpdate( float val, float ratioPassed){
  60. if(this.onUpdateFloat!=null)
  61. this.onUpdateFloat(val);
  62. if (this.onUpdateFloatRatio != null){
  63. this.onUpdateFloatRatio(val,ratioPassed);
  64. }else if(this.onUpdateFloatObject!=null){
  65. this.onUpdateFloatObject(val, this.onUpdateParam);
  66. }else if(this.onUpdateVector3Object!=null){
  67. this.onUpdateVector3Object(LTDescr.newVect, this.onUpdateParam);
  68. }else if(this.onUpdateVector3!=null){
  69. this.onUpdateVector3(LTDescr.newVect);
  70. }else if(this.onUpdateVector2!=null){
  71. this.onUpdateVector2(new Vector2(LTDescr.newVect.x,LTDescr.newVect.y));
  72. }
  73. }
  74. }
  75. //}