ExtensionAnim.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. using UnityEngine;
  2. using UnityEngine.Events;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. public static class ExtensionAnim
  6. {
  7. #region Move
  8. public static Shake Shake(this Component comp, float duration, int repeat, Vector3 strength, Curve curve)
  9. {
  10. return ManaAnim.Shake(comp.transform, duration, repeat, strength, curve);
  11. }
  12. public static Move2D Move2D(this Component comp, Vector3 destination, float duration, bool local, Curve curve)
  13. {
  14. return ManaAnim.Move2D(comp.transform, destination, duration, local, curve);
  15. }
  16. public static Move3D Move3D(this Component comp, Vector3 destination, float duration, bool local, Curve curve)
  17. {
  18. return ManaAnim.Move3D(comp.transform, destination, duration, local, curve);
  19. }
  20. public static Move2D MoveOffset2D(this Component comp, Vector3 offset, float duration, bool local, Curve curve)
  21. {
  22. return ManaAnim.MoveOffset2D(comp.transform, offset, duration, local, curve);
  23. }
  24. public static Move3D MoveOffset3D(this Component comp, Vector3 offset, float duration, bool local, Curve curve)
  25. {
  26. return ManaAnim.MoveOffset3D(comp.transform, offset, duration, local, curve);
  27. }
  28. public static Zoom2D Zoom2D(this Transform target, float origin, float destination, float duration, float stay, Transform targetZoom, Curve curve)
  29. {
  30. return ManaAnim.Zoom2D(target, origin, destination, duration, stay, targetZoom, curve);
  31. }
  32. public static Zoom2D Zoom2D(this Transform target, float destination, float duration, float stay, Transform targetZoom, Curve curve)
  33. {
  34. return ManaAnim.Zoom2D(target, destination, duration, stay, targetZoom, curve);
  35. }
  36. public static Shake GetShake(this Component comp)
  37. {
  38. return ManaAnim.GetShake(comp.transform);
  39. }
  40. public static Move2D GetMove2D(this Component comp)
  41. {
  42. return ManaAnim.GetMove2D(comp.transform);
  43. }
  44. public static Move3D GetMove3D(this Component comp)
  45. {
  46. return ManaAnim.GetMove3D(comp.transform);
  47. }
  48. public static Zoom2D GetZoom2D(this Component comp)
  49. {
  50. return ManaAnim.GetZoom2D(comp.transform);
  51. }
  52. public static Shake CreateShake(this Component comp)
  53. {
  54. return ManaAnim.CreateShake(comp.transform);
  55. }
  56. public static Move2D CreateMove2D(this Component comp)
  57. {
  58. return ManaAnim.CreateMove2D(comp.transform);
  59. }
  60. public static Move3D CreateMove3D(this Component comp)
  61. {
  62. return ManaAnim.CreateMove3D(comp.transform);
  63. }
  64. public static Zoom2D CreateZoom2D(this Component comp)
  65. {
  66. return ManaAnim.CreateZoom2D(comp.transform);
  67. }
  68. #endregion
  69. #region Tween
  70. public static TweenSr TweenForSr(this Component comp)
  71. {
  72. return ManaAnim.TweenForSr(comp.transform);
  73. }
  74. public static TweenCG TweenForCG(this Component comp)
  75. {
  76. return ManaAnim.TweenForCG(comp.transform);
  77. }
  78. public static TweenVec TweenForVec(this Component comp)
  79. {
  80. return ManaAnim.TweenForVec(comp.transform);
  81. }
  82. public static TweenGra TweenForGra(this Component comp)
  83. {
  84. return ManaAnim.TweenForGra(comp.transform);
  85. }
  86. public static TweenFont TweenForFont(this Component comp)
  87. {
  88. return ManaAnim.TweenForFont(comp.transform);
  89. }
  90. public static TweenRect TweenForRect(this Component comp)
  91. {
  92. return ManaAnim.TweenForRect(comp.transform);
  93. }
  94. public static TweenScale TweenForScale(this Component comp)
  95. {
  96. return ManaAnim.TweenForScale(comp.transform);
  97. }
  98. public static TweenAudio TweenForAudio(this Component comp)
  99. {
  100. return ManaAnim.TweenForAudio(comp.transform);
  101. }
  102. public static TweenAudio TweenForAudio(this AudioSource audioSource)
  103. {
  104. return ManaAnim.TweenForAudio(audioSource);
  105. }
  106. public static TweenOutline TweenForOutline(this Component comp)
  107. {
  108. return ManaAnim.TweenForOutline(comp.transform);
  109. }
  110. public static TweenNumber TweenForNumber(this Component comp)
  111. {
  112. return ManaAnim.TweenForNumber(comp.transform);
  113. }
  114. public static TweenSr TweenBacSr(this Component comp)
  115. {
  116. return ManaAnim.TweenBacSr(comp.transform);
  117. }
  118. public static TweenCG TweenBacCG(this Component comp)
  119. {
  120. return ManaAnim.TweenBacCG(comp.transform);
  121. }
  122. public static TweenVec TweenBacVec(this Component comp)
  123. {
  124. return ManaAnim.TweenBacVec(comp.transform);
  125. }
  126. public static TweenGra TweenBacGra(this Component comp)
  127. {
  128. return ManaAnim.TweenBacGra(comp.transform);
  129. }
  130. public static TweenFont TweenBacFont(this Component comp)
  131. {
  132. return ManaAnim.TweenBacFont(comp.transform);
  133. }
  134. public static TweenRect TweenBacRect(this Component comp)
  135. {
  136. return ManaAnim.TweenBacRect(comp.transform);
  137. }
  138. public static TweenScale TweenBacScale(this Component comp)
  139. {
  140. return ManaAnim.TweenBacScale(comp.transform);
  141. }
  142. public static TweenAudio TweenBacAudio(this Component comp)
  143. {
  144. return ManaAnim.TweenBacAudio(comp.transform);
  145. }
  146. public static TweenAudio TweenBacAudio(this AudioSource audioSource)
  147. {
  148. return ManaAnim.TweenBacAudio(audioSource);
  149. }
  150. public static TweenOutline TweenBacOutline(this Component comp)
  151. {
  152. return ManaAnim.TweenBacOutline(comp.transform);
  153. }
  154. public static TweenNumber TweenBacNumber(this Component comp)
  155. {
  156. return ManaAnim.TweenBacNumber(comp.transform);
  157. }
  158. public static TweenSr TweenReForSr(this Component comp)
  159. {
  160. return ManaAnim.TweenReForSr(comp.transform);
  161. }
  162. public static TweenCG TweenReForCG(this Component comp)
  163. {
  164. return ManaAnim.TweenReForCG(comp.transform);
  165. }
  166. public static TweenVec TweenReForVec(this Component comp)
  167. {
  168. return ManaAnim.TweenReForVec(comp.transform);
  169. }
  170. public static TweenGra TweenReForGra(this Component comp)
  171. {
  172. return ManaAnim.TweenReForGra(comp.transform);
  173. }
  174. public static TweenFont TweenReForFont(this Component comp)
  175. {
  176. return ManaAnim.TweenReForFont(comp.transform);
  177. }
  178. public static TweenRect TweenReForRect(this Component comp)
  179. {
  180. return ManaAnim.TweenReForRect(comp.transform);
  181. }
  182. public static TweenScale TweenReForScale(this Component comp)
  183. {
  184. return ManaAnim.TweenReForScale(comp.transform);
  185. }
  186. public static TweenAudio TweenReForAudio(this Component comp)
  187. {
  188. return ManaAnim.TweenReForAudio(comp.transform);
  189. }
  190. public static TweenAudio TweenReForAudio(this AudioSource audioSource)
  191. {
  192. return ManaAnim.TweenReForAudio(audioSource);
  193. }
  194. public static TweenOutline TweenReForOutline(this Component comp)
  195. {
  196. return ManaAnim.TweenReForOutline(comp.transform);
  197. }
  198. public static TweenNumber TweenReForNumber(this Component comp)
  199. {
  200. return ManaAnim.TweenReForNumber(comp.transform);
  201. }
  202. public static TweenSr TweenReBacSr(this Component comp)
  203. {
  204. return ManaAnim.TweenReBacSr(comp.transform);
  205. }
  206. public static TweenCG TweenReBacCG(this Component comp)
  207. {
  208. return ManaAnim.TweenReBacCG(comp.transform);
  209. }
  210. public static TweenVec TweenReBacVec(this Component comp)
  211. {
  212. return ManaAnim.TweenReBacVec(comp.transform);
  213. }
  214. public static TweenGra TweenReBacGra(this Component comp)
  215. {
  216. return ManaAnim.TweenReBacGra(comp.transform);
  217. }
  218. public static TweenFont TweenReBacFont(this Component comp)
  219. {
  220. return ManaAnim.TweenReBacFont(comp.transform);
  221. }
  222. public static TweenRect TweenReBacRect(this Component comp)
  223. {
  224. return ManaAnim.TweenReBacRect(comp.transform);
  225. }
  226. public static TweenScale TweenReBacScale(this Component comp)
  227. {
  228. return ManaAnim.TweenReBacScale(comp.transform);
  229. }
  230. public static TweenAudio TweenReBacAudio(this Component comp)
  231. {
  232. return ManaAnim.TweenReBacAudio(comp.transform);
  233. }
  234. public static TweenAudio TweenReBacAudio(this AudioSource audioSource)
  235. {
  236. return ManaAnim.TweenReBacAudio(audioSource);
  237. }
  238. public static TweenOutline TweenReBacOutline(this Component comp)
  239. {
  240. return ManaAnim.TweenReBacOutline(comp.transform);
  241. }
  242. public static TweenNumber TweenReBacNumber(this Component comp)
  243. {
  244. return ManaAnim.TweenReBacNumber(comp.transform);
  245. }
  246. public static TweenSr GetTweenSr(this Component comp)
  247. {
  248. return ManaAnim.GetTweenSr(comp.transform);
  249. }
  250. public static TweenCG GetTweenCG(this Component comp)
  251. {
  252. return ManaAnim.GetTweenCG(comp.transform);
  253. }
  254. public static TweenVec GetTweenVec(this Component comp)
  255. {
  256. return ManaAnim.GetTweenVec(comp.transform);
  257. }
  258. public static TweenGra GetTweenGra(this Component comp)
  259. {
  260. return ManaAnim.GetTweenGra(comp.transform);
  261. }
  262. public static TweenFont GetTweenFont(this Component comp)
  263. {
  264. return ManaAnim.GetTweenFont(comp.transform);
  265. }
  266. public static TweenRect GetTweenRect(this Component comp)
  267. {
  268. return ManaAnim.GetTweenRect(comp.transform);
  269. }
  270. public static TweenScale GetTweenScale(this Component comp)
  271. {
  272. return ManaAnim.GetTweenScale(comp.transform);
  273. }
  274. public static TweenAudio GetTweenAudio(this Component comp)
  275. {
  276. return ManaAnim.GetTweenAudio(comp.transform);
  277. }
  278. public static TweenAudio GetTweenAudio(this AudioSource audioSource)
  279. {
  280. return ManaAnim.GetTweenAudio(audioSource);
  281. }
  282. public static TweenOutline GetTweenOutline(this Component comp)
  283. {
  284. return ManaAnim.GetTweenOutline(comp.transform);
  285. }
  286. public static TweenNumber GetTweenNumber(this Component comp)
  287. {
  288. return ManaAnim.GetTweenNumber(comp.transform);
  289. }
  290. public static TweenSr CreateTweenSr(this Component comp, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
  291. {
  292. return ManaAnim.CreateTweenSr(comp.transform, origin, destination, duration, originActive, destActive, curve, cg, group);
  293. }
  294. public static TweenSr CreateTweenSr(this Component comp, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
  295. {
  296. return ManaAnim.CreateTweenSr(comp.transform, destination, duration, originActive, destActive, curve, cg, group);
  297. }
  298. public static TweenSr CreateTweenSr(this Component comp, Color origin, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
  299. {
  300. return ManaAnim.CreateTweenSr(comp.transform, origin, destination, duration, originActive, destActive, curve, cg, group);
  301. }
  302. public static TweenSr CreateTweenSr(this Component comp, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
  303. {
  304. return ManaAnim.CreateTweenSr(comp.transform, destination, duration, originActive, destActive, curve, cg, group);
  305. }
  306. public static TweenCG CreateTweenCG(this Component comp, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve)
  307. {
  308. return ManaAnim.CreateTweenCG(comp.transform, origin, destination, duration, originActive, destActive, curve);
  309. }
  310. public static TweenCG CreateTweenCG(this Component comp, float destination, float duration, bool originActive, bool destActive, Curve curve)
  311. {
  312. return ManaAnim.CreateTweenCG(comp.transform, destination, duration, originActive, destActive, curve);
  313. }
  314. public static TweenGra CreateTweenGra(this Component comp, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  315. {
  316. return ManaAnim.CreateTweenGra(comp.transform, origin, destination, duration, originActive, destActive, curve, cg);
  317. }
  318. public static TweenGra CreateTweenGra(this Component comp, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  319. {
  320. return ManaAnim.CreateTweenGra(comp.transform, destination, duration, originActive, destActive, curve, cg);
  321. }
  322. public static TweenGra CreateTweenGra(this Component comp, Color origin, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  323. {
  324. return ManaAnim.CreateTweenGra(comp.transform, origin, destination, duration, originActive, destActive, curve, cg);
  325. }
  326. public static TweenGra CreateTweenGra(this Component comp, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  327. {
  328. return ManaAnim.CreateTweenGra(comp.transform, destination, duration, originActive, destActive, curve, cg);
  329. }
  330. public static TweenVec CreateTweenVec2D(this Component comp, Vector3 origin, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
  331. {
  332. return ManaAnim.CreateTweenVec2D(comp.transform, origin, destination, duration, local, originActive, destActive, curve, cg);
  333. }
  334. public static TweenVec CreateTweenVec2D(this Component comp, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
  335. {
  336. return ManaAnim.CreateTweenVec2D(comp.transform, destination, duration, local, originActive, destActive, curve, cg);
  337. }
  338. public static TweenVec CreateTweenVec3D(this Component comp, Vector3 origin, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
  339. {
  340. return ManaAnim.CreateTweenVec3D(comp.transform, origin, destination, duration, local, originActive, destActive, curve, cg);
  341. }
  342. public static TweenVec CreateTweenVec3D(this Component comp, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
  343. {
  344. return ManaAnim.CreateTweenVec3D(comp.transform, destination, duration, local, originActive, destActive, curve, cg);
  345. }
  346. public static TweenVec CreateTweenVecOffset2D(this Component comp, Vector3 offset, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
  347. {
  348. return ManaAnim.CreateTweenVecOffset2D(comp.transform, offset, duration, local, originActive, destActive, curve, cg);
  349. }
  350. public static TweenVec CreateTweenVecOffset3D(this Component comp, Vector3 offset, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
  351. {
  352. return ManaAnim.CreateTweenVecOffset3D(comp.transform, offset, duration, local, originActive, destActive, curve, cg);
  353. }
  354. public static TweenFont CreateTweenFont(this Component comp, int origin, int destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  355. {
  356. return ManaAnim.CreateTweenFont(comp.transform, origin, destination, duration, originActive, destActive, curve, cg);
  357. }
  358. public static TweenFont CreateTweenFont(this Component comp, int destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  359. {
  360. return ManaAnim.CreateTweenFont(comp.transform, destination, duration, originActive, destActive, curve, cg);
  361. }
  362. public static TweenRect CreateTweenRect(this Component comp, Vector3 origin, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  363. {
  364. return ManaAnim.CreateTweenRect(comp.transform, origin, destination, duration, originActive, destActive, curve, cg);
  365. }
  366. public static TweenRect CreateTweenRect(this Component comp, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  367. {
  368. return ManaAnim.CreateTweenRect(comp.transform, destination, duration, originActive, destActive, curve, cg);
  369. }
  370. public static TweenScale CreateTweenScale(this Component comp, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  371. {
  372. return ManaAnim.CreateTweenScale(comp.transform, origin, destination, duration, originActive, destActive, curve, cg);
  373. }
  374. public static TweenScale CreateTweenScale(this Component comp, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  375. {
  376. return ManaAnim.CreateTweenScale(comp.transform, destination, duration, originActive, destActive, curve, cg);
  377. }
  378. public static TweenScale CreateTweenScale(this Component comp, Vector3 origin, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  379. {
  380. return ManaAnim.CreateTweenScale(comp.transform, origin, destination, duration, originActive, destActive, curve, cg);
  381. }
  382. public static TweenScale CreateTweenScale(this Component comp, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  383. {
  384. return ManaAnim.CreateTweenScale(comp.transform, destination, duration, originActive, destActive, curve, cg);
  385. }
  386. public static TweenAudio CreateTweenAudio(this Component comp, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  387. {
  388. return ManaAnim.CreateTweenAudio(comp.transform, origin, destination, duration, originActive, destActive, curve, cg);
  389. }
  390. public static TweenAudio CreateTweenAudio(this Component comp, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  391. {
  392. return ManaAnim.CreateTweenAudio(comp.transform, destination, duration, originActive, destActive, curve, cg);
  393. }
  394. public static TweenAudio CreateTweenAudio(this AudioSource audioSource, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  395. {
  396. return ManaAnim.CreateTweenAudio(audioSource, origin, destination, duration, originActive, destActive, curve, cg);
  397. }
  398. public static TweenAudio CreateTweenAudio(this AudioSource audioSource, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  399. {
  400. return ManaAnim.CreateTweenAudio(audioSource, destination, duration, originActive, destActive, curve, cg);
  401. }
  402. public static TweenOutline CreateTweenOutline(this Component comp, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  403. {
  404. return ManaAnim.CreateTweenOutline(comp.transform, origin, destination, duration, originActive, destActive, curve, cg);
  405. }
  406. public static TweenOutline CreateTweenOutline(this Component comp, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  407. {
  408. return ManaAnim.CreateTweenOutline(comp.transform, destination, duration, originActive, destActive, curve, cg);
  409. }
  410. public static TweenOutline CreateTweenOutline(this Component comp, Color origin, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  411. {
  412. return ManaAnim.CreateTweenOutline(comp.transform, origin, destination, duration, originActive, destActive, curve, cg);
  413. }
  414. public static TweenOutline CreateTweenOutline(this Component comp, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  415. {
  416. return ManaAnim.CreateTweenOutline(comp.transform, destination, duration, originActive, destActive, curve, cg);
  417. }
  418. public static TweenNumber CreateTweenNumber(this Component comp, int origin, int destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  419. {
  420. return ManaAnim.CreateTweenNumber(comp.transform, origin, destination, duration, originActive, destActive, curve, cg);
  421. }
  422. public static TweenNumber CreateTweenNumber(this Component comp, int destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
  423. {
  424. return ManaAnim.CreateTweenNumber(comp.transform, destination, duration, originActive, destActive, curve, cg);
  425. }
  426. #endregion
  427. #region Stream
  428. public static StreamScale StreamForScale(this Component comp)
  429. {
  430. return ManaAnim.StreamForScale(comp.transform);
  431. }
  432. public static StreamScale StreamBacScale(this Component comp)
  433. {
  434. return ManaAnim.StreamBacScale(comp.transform);
  435. }
  436. public static StreamScale StreamReForScale(this Component comp)
  437. {
  438. return ManaAnim.StreamReForScale(comp.transform);
  439. }
  440. public static StreamScale StreamReBacScale(this Component comp)
  441. {
  442. return ManaAnim.StreamReBacScale(comp.transform);
  443. }
  444. public static StreamScale GetStreamScale(this Component comp)
  445. {
  446. return ManaAnim.GetStreamScale(comp.transform);
  447. }
  448. public static StreamScale CreateStreamScale(this Component comp, List<float> delayList, List<float> durationList, List<VecPair> destKvList, bool originActive, bool destActive, Curve curve, bool cg = false, List<UnityAction> startActionList = null, List<UnityAction> finishActionList = null)
  449. {
  450. return ManaAnim.CreateStreamScale(comp.transform, delayList, durationList, destKvList, originActive, destActive, curve, cg, startActionList, finishActionList);
  451. }
  452. public static StreamScale CreateStreamScale(this Component comp, List<float> delayList, List<float> durationList, List<Vector3> destList, bool originActive, bool destActive, Curve curve, bool cg = false, List<UnityAction> startActionList = null, List<UnityAction> finishActionList = null)
  453. {
  454. return ManaAnim.CreateStreamScale(comp.transform, delayList, durationList, destList, originActive, destActive, curve, cg, startActionList, finishActionList);
  455. }
  456. #endregion
  457. }