TweenHash.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using System;
  2. using System.Collections;
  3. using UnityEngine;
  4. namespace wf
  5. {
  6. public static class TweenHash
  7. {
  8. public static Hashtable EaseOutQuint(TweenHash.Type type, Vector3 local_pos, float time)
  9. {
  10. return iTween.Hash(new object[]
  11. {
  12. TweenHash.TypeAsString(type),
  13. local_pos,
  14. "islocal",
  15. true,
  16. "time",
  17. time,
  18. "easeType",
  19. iTween.EaseType.easeOutQuint
  20. });
  21. }
  22. public static Hashtable EaseOutSine(TweenHash.Type type, Vector3 local_pos, float time)
  23. {
  24. return iTween.Hash(new object[]
  25. {
  26. TweenHash.TypeAsString(type),
  27. local_pos,
  28. "islocal",
  29. true,
  30. "time",
  31. time,
  32. "easeType",
  33. iTween.EaseType.easeOutSine
  34. });
  35. }
  36. private static string TypeAsString(TweenHash.Type type)
  37. {
  38. string result = string.Empty;
  39. if (type != TweenHash.Type.Position)
  40. {
  41. if (type != TweenHash.Type.Scale)
  42. {
  43. if (type == TweenHash.Type.Rotation)
  44. {
  45. result = "rotation";
  46. }
  47. }
  48. else
  49. {
  50. result = "scale";
  51. }
  52. }
  53. else
  54. {
  55. result = "position";
  56. }
  57. return result;
  58. }
  59. public enum Type
  60. {
  61. Position,
  62. Scale,
  63. Rotation
  64. }
  65. }
  66. }