EffectLayer.cs 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace Xft
  5. {
  6. public class EffectLayer : MonoBehaviour
  7. {
  8. public Plane CollisionPlane
  9. {
  10. get
  11. {
  12. return this.mCollisionPlane;
  13. }
  14. }
  15. public Camera MyCamera
  16. {
  17. get
  18. {
  19. return this.Owner.MyCamera;
  20. }
  21. }
  22. protected void InitCollision()
  23. {
  24. if (!this.UseCollisionDetection)
  25. {
  26. return;
  27. }
  28. this.mCollisionPlane = new Plane(this.PlaneDir.normalized, base.transform.position + this.PlaneOffset);
  29. if (this.CollisionType == COLLITION_TYPE.CollisionLayer || this.CollisionType == COLLITION_TYPE.Plane)
  30. {
  31. return;
  32. }
  33. if (this.CollisionGoal == null)
  34. {
  35. }
  36. }
  37. public List<Affector> InitAffectors(EffectNode node)
  38. {
  39. List<Affector> list = new List<Affector>();
  40. if (this.UVAffectorEnable)
  41. {
  42. UVAnimation uvanimation = new UVAnimation();
  43. if (this.UVType == 1)
  44. {
  45. float x = this.OriUVDimensions.x / (float)this.Cols;
  46. float y = Mathf.Abs(this.OriUVDimensions.y / (float)this.Rows);
  47. Vector2 cellSize = new Vector2(x, y);
  48. uvanimation.BuildUVAnim(this.OriTopLeftUV, cellSize, this.Cols, this.Rows, this.Cols * this.Rows);
  49. }
  50. this.UVDimension = uvanimation.UVDimensions[0];
  51. this.UVTopLeft = uvanimation.frames[0];
  52. if (uvanimation.frames.Length != 1)
  53. {
  54. uvanimation.loopCycles = this.LoopCircles;
  55. Affector item = new UVAffector(uvanimation, this.UVTime, node, this.RandomStartFrame);
  56. list.Add(item);
  57. }
  58. }
  59. else
  60. {
  61. this.UVDimension = this.OriUVDimensions;
  62. this.UVTopLeft = this.OriTopLeftUV;
  63. }
  64. if (this.RotAffectorEnable && this.RotateType != RSTYPE.NONE)
  65. {
  66. Affector item2;
  67. if (this.RotateType == RSTYPE.NONE)
  68. {
  69. item2 = new RotateAffector(this.DeltaRot, node);
  70. }
  71. else
  72. {
  73. item2 = new RotateAffector(this.RotateType, node);
  74. }
  75. list.Add(item2);
  76. }
  77. if (this.ScaleAffectorEnable && this.ScaleType != RSTYPE.NONE)
  78. {
  79. Affector item3;
  80. if (this.ScaleType == RSTYPE.NONE)
  81. {
  82. item3 = new ScaleAffector(this.DeltaScaleX, this.DeltaScaleY, node);
  83. }
  84. else
  85. {
  86. item3 = new ScaleAffector(this.ScaleType, node);
  87. }
  88. list.Add(item3);
  89. }
  90. if (this.ColorAffectorEnable)
  91. {
  92. ColorAffector item4 = new ColorAffector(this, node);
  93. list.Add(item4);
  94. }
  95. if (this.JetAffectorEnable)
  96. {
  97. Affector item5 = new JetAffector(this.JetMag, this.JetMagType, this.JetCurve, node);
  98. list.Add(item5);
  99. }
  100. if (this.VortexAffectorEnable)
  101. {
  102. Affector item6 = new VortexAffector(this.VortexObj, this.VortexDirection, this.VortexInheritRotation, node);
  103. list.Add(item6);
  104. }
  105. if (this.UVRotAffectorEnable)
  106. {
  107. float rotXSpeed = this.UVRotXSpeed;
  108. float rotYSpeed = this.UVRotYSpeed;
  109. if (this.RandomUVRotateSpeed)
  110. {
  111. rotXSpeed = UnityEngine.Random.Range(this.UVRotXSpeed, this.UVRotXSpeedMax);
  112. rotYSpeed = UnityEngine.Random.Range(this.UVRotYSpeed, this.UVRotYSpeedMax);
  113. }
  114. Affector item7 = new UVRotAffector(rotXSpeed, rotYSpeed, node);
  115. list.Add(item7);
  116. }
  117. if (this.UVScaleAffectorEnable)
  118. {
  119. Affector item8 = new UVScaleAffector(node);
  120. list.Add(item8);
  121. }
  122. if (this.GravityAffectorEnable)
  123. {
  124. Affector item9 = new GravityAffector(this.GravityObject, this.GravityAftType, this.IsGravityAccelerate, this.GravityDirection, node);
  125. list.Add(item9);
  126. if (this.GravityAftType == GAFTTYPE.Spherical && this.GravityObject == null)
  127. {
  128. UnityEngine.Debug.LogWarning("Gravity UnityEngine.Object is missing, automatically set to effect layer self:" + base.gameObject.name);
  129. this.GravityObject = base.transform;
  130. }
  131. }
  132. if (this.AirAffectorEnable)
  133. {
  134. Affector item10 = new AirFieldAffector(this.AirObject, this.AirDirection, this.AirAttenuation, this.AirUseMaxDistance, this.AirMaxDistance, this.AirEnableSpread, this.AirSpread, this.AirInheritVelocity, this.AirInheritRotation, node);
  135. list.Add(item10);
  136. }
  137. if (this.BombAffectorEnable)
  138. {
  139. Affector item11 = new BombAffector(this.BombObject, this.BombType, this.BombDecayType, this.BombMagnitude, this.BombDecay, this.BombAxis, node);
  140. list.Add(item11);
  141. }
  142. if (this.TurbulenceAffectorEnable)
  143. {
  144. Affector item12 = new TurbulenceFieldAffector(this.TurbulenceObject, this.TurbulenceAttenuation, this.TurbulenceUseMaxDistance, this.TurbulenceMaxDistance, node);
  145. list.Add(item12);
  146. }
  147. if (this.DragAffectorEnable)
  148. {
  149. Affector item13 = new DragAffector(this.DragObj, this.DragUseDir, this.DragDir, this.DragMag, this.DragUseMaxDist, this.DragMaxDist, this.DragAtten, node);
  150. list.Add(item13);
  151. }
  152. if (this.SineAffectorEnable)
  153. {
  154. Affector item14 = new SineAffector(node);
  155. list.Add(item14);
  156. }
  157. return list;
  158. }
  159. public void SetClient(Transform client)
  160. {
  161. this.ClientTransform = client;
  162. for (int i = 0; i < this.MaxENodes; i++)
  163. {
  164. EffectNode effectNode = this.ActiveENodes[i];
  165. if (effectNode == null)
  166. {
  167. effectNode = this.AvailableENodes[i];
  168. }
  169. effectNode.ClientTrans = client;
  170. }
  171. }
  172. protected void Init()
  173. {
  174. this.InitCollision();
  175. this.Owner = base.transform.parent.gameObject.GetComponent<XffectComponent>();
  176. if (this.Owner == null)
  177. {
  178. UnityEngine.Debug.LogError("you must set EffectLayer to be XffectComponent's child.");
  179. }
  180. if (this.ClientTransform == null)
  181. {
  182. UnityEngine.Debug.LogWarning("effect layer: " + base.gameObject.name + " haven't assign a client transform, automaticly set to itself.");
  183. this.ClientTransform = base.transform;
  184. }
  185. this.AvailableENodes = new EffectNode[this.MaxENodes];
  186. this.ActiveENodes = new EffectNode[this.MaxENodes];
  187. for (int i = 0; i < this.MaxENodes; i++)
  188. {
  189. EffectNode effectNode = new EffectNode(i, this.ClientTransform, this.SyncClient, this);
  190. List<Affector> affectorList = this.InitAffectors(effectNode);
  191. effectNode.SetAffectorList(affectorList);
  192. effectNode.SetRenderType(this.RenderType);
  193. this.AvailableENodes[i] = effectNode;
  194. }
  195. if (this.RenderType == 4)
  196. {
  197. this.RopeDatas.Init(this);
  198. }
  199. this.AvailableNodeCount = this.MaxENodes;
  200. this.emitter = new Emitter(this);
  201. this.mStopped = false;
  202. }
  203. public VertexPool GetVertexPool()
  204. {
  205. return this.Vertexpool;
  206. }
  207. public int GetActiveNodeCount()
  208. {
  209. return this.ActiveENodes.Length;
  210. }
  211. public void RemoveActiveNode(EffectNode node)
  212. {
  213. if (this.AvailableNodeCount == this.MaxENodes)
  214. {
  215. UnityEngine.Debug.LogError("something wrong with removing node!");
  216. return;
  217. }
  218. if (this.ActiveENodes[node.Index] == null)
  219. {
  220. return;
  221. }
  222. this.ActiveENodes[node.Index] = null;
  223. this.AvailableENodes[node.Index] = node;
  224. this.AvailableNodeCount++;
  225. }
  226. public void AddActiveNode(EffectNode node)
  227. {
  228. if (this.AvailableNodeCount == 0)
  229. {
  230. UnityEngine.Debug.LogError("out index!");
  231. }
  232. if (this.AvailableENodes[node.Index] == null)
  233. {
  234. return;
  235. }
  236. this.ActiveENodes[node.Index] = node;
  237. this.AvailableENodes[node.Index] = null;
  238. this.AvailableNodeCount--;
  239. ulong totalAddedCount;
  240. this.TotalAddedCount = (totalAddedCount = this.TotalAddedCount) + 1UL;
  241. node.TotalIndex = totalAddedCount;
  242. }
  243. protected void AddNodes(int num)
  244. {
  245. int num2 = 0;
  246. for (int i = 0; i < this.MaxENodes; i++)
  247. {
  248. if (num2 == num)
  249. {
  250. break;
  251. }
  252. EffectNode effectNode = this.AvailableENodes[i];
  253. if (effectNode != null)
  254. {
  255. this.AddActiveNode(effectNode);
  256. num2++;
  257. if (this.UseSubEmitters && !string.IsNullOrEmpty(this.BirthSubEmitter))
  258. {
  259. XffectComponent effect = this.SpawnCache.GetEffect(this.BirthSubEmitter);
  260. if (effect == null)
  261. {
  262. return;
  263. }
  264. effectNode.SubEmitter = effect;
  265. effect.Active();
  266. }
  267. this.emitter.SetEmitPosition(effectNode);
  268. float life;
  269. if (this.IsNodeLifeLoop)
  270. {
  271. life = -1f;
  272. }
  273. else
  274. {
  275. life = UnityEngine.Random.Range(this.NodeLifeMin, this.NodeLifeMax);
  276. }
  277. Vector3 emitRotation = this.emitter.GetEmitRotation(effectNode);
  278. float speed = this.OriSpeed;
  279. if (this.IsRandomSpeed)
  280. {
  281. speed = UnityEngine.Random.Range(this.SpeedMin, this.SpeedMax);
  282. }
  283. Color oriColor = this.Color1;
  284. if (this.IsRandomStartColor)
  285. {
  286. oriColor = this.RandomColorGradient.Evaluate(UnityEngine.Random.Range(0f, 1f));
  287. }
  288. float num3 = UnityEngine.Random.Range(this.OriScaleXMin, this.OriScaleXMax);
  289. float oriScaleY = UnityEngine.Random.Range(this.OriScaleYMin, this.OriScaleYMax);
  290. if (this.UniformRandomScale)
  291. {
  292. oriScaleY = num3;
  293. }
  294. effectNode.Init(emitRotation.normalized, speed, life, UnityEngine.Random.Range(this.OriRotationMin, this.OriRotationMax), num3, oriScaleY, oriColor, this.UVTopLeft, this.UVDimension);
  295. }
  296. }
  297. }
  298. public void Reset()
  299. {
  300. if (this.ActiveENodes == null)
  301. {
  302. return;
  303. }
  304. for (int i = 0; i < this.MaxENodes; i++)
  305. {
  306. EffectNode effectNode = this.ActiveENodes[i];
  307. if (effectNode != null)
  308. {
  309. effectNode.Reset();
  310. this.RemoveActiveNode(effectNode);
  311. }
  312. }
  313. this.emitter.Reset();
  314. this.mStopped = false;
  315. this.TotalAddedCount = 0UL;
  316. }
  317. public void FixedUpdateCustom(float deltaTime)
  318. {
  319. int nodes = this.emitter.GetNodes(deltaTime);
  320. this.AddNodes(nodes);
  321. for (int i = 0; i < this.MaxENodes; i++)
  322. {
  323. EffectNode effectNode = this.ActiveENodes[i];
  324. if (effectNode != null)
  325. {
  326. effectNode.Update(deltaTime);
  327. }
  328. }
  329. if (this.RenderType == 4)
  330. {
  331. this.RopeDatas.Update(deltaTime);
  332. }
  333. }
  334. public void StartCustom()
  335. {
  336. this.Init();
  337. this.LastClientPos = this.ClientTransform.position;
  338. }
  339. private void OnDrawGizmos()
  340. {
  341. if (this.ClientTransform == null)
  342. {
  343. return;
  344. }
  345. Gizmos.color = this.DebugColor;
  346. float num;
  347. if (this.RenderType == 0)
  348. {
  349. num = (this.SpriteWidth + this.SpriteHeight) / 6f;
  350. }
  351. else if (this.RenderType == 1)
  352. {
  353. num = this.RibbonWidth / 3f;
  354. }
  355. else
  356. {
  357. num = (this.ConeSize.x + this.ConeSize.y) / 6f;
  358. }
  359. num = Mathf.Clamp(num, 0f, 1f);
  360. if (this.EmitType == 0 || this.EmitType == 3)
  361. {
  362. Gizmos.DrawWireSphere(this.ClientTransform.position + this.EmitPoint, num);
  363. }
  364. if (this.EmitType == 1)
  365. {
  366. Vector3 size = this.BoxSize;
  367. if (this.Owner != null)
  368. {
  369. size = this.BoxSize * this.Owner.Scale;
  370. }
  371. Gizmos.DrawWireCube(this.ClientTransform.position + this.EmitPoint, size);
  372. }
  373. else if (this.EmitType == 2)
  374. {
  375. Gizmos.DrawWireSphere(this.ClientTransform.position + this.EmitPoint, this.Radius);
  376. }
  377. else if (this.EmitType == 4)
  378. {
  379. if (this.LineStartObj != null && this.LineEndObj != null)
  380. {
  381. Vector3 position = this.LineStartObj.position;
  382. Vector3 position2 = this.LineEndObj.position;
  383. Gizmos.DrawLine(position, position2);
  384. }
  385. }
  386. else if (this.EmitType == 5)
  387. {
  388. }
  389. if (this.OriVelocityAxis != Vector3.zero)
  390. {
  391. Gizmos.DrawLine(this.ClientTransform.position + this.EmitPoint, this.ClientTransform.position + this.EmitPoint + this.ClientTransform.rotation * this.OriVelocityAxis * num * 15f);
  392. }
  393. if (this.UseCollisionDetection && this.CollisionType == COLLITION_TYPE.Plane)
  394. {
  395. Gizmos.color = Color.green;
  396. Gizmos.DrawWireCube(this.ClientTransform.position + this.PlaneOffset, new Vector3(num * 300f, 0f, num * 300f));
  397. Gizmos.color = Color.white;
  398. }
  399. }
  400. public bool EmitOver(float deltaTime)
  401. {
  402. if (this.ActiveENodes == null)
  403. {
  404. return false;
  405. }
  406. if (this.AvailableNodeCount == this.MaxENodes)
  407. {
  408. if (this.EmitWay == EEmitWay.ByRate)
  409. {
  410. if (this.emitter.EmitLoop == 0f)
  411. {
  412. return true;
  413. }
  414. }
  415. else if (this.EmitWay == EEmitWay.ByCurve)
  416. {
  417. if (this.emitter.CurveEmitDone)
  418. {
  419. return true;
  420. }
  421. }
  422. else if (this.EmitWay == EEmitWay.ByDistance && this.mStopped)
  423. {
  424. return true;
  425. }
  426. }
  427. return false;
  428. }
  429. public void StopSmoothly(float fadeTime)
  430. {
  431. this.mStopped = true;
  432. this.emitter.StopEmit();
  433. for (int i = 0; i < this.MaxENodes; i++)
  434. {
  435. EffectNode effectNode = this.ActiveENodes[i];
  436. if (effectNode != null)
  437. {
  438. if (!this.IsNodeLifeLoop && effectNode.GetLifeTime() < fadeTime)
  439. {
  440. fadeTime = effectNode.GetLifeTime() - effectNode.GetElapsedTime();
  441. }
  442. effectNode.Fade(fadeTime);
  443. }
  444. }
  445. }
  446. public void StopEmit()
  447. {
  448. this.mStopped = true;
  449. if (this.IsNodeLifeLoop && this.EmitWay != EEmitWay.ByDistance)
  450. {
  451. for (int i = 0; i < this.MaxENodes; i++)
  452. {
  453. EffectNode effectNode = this.ActiveENodes[i];
  454. if (effectNode != null)
  455. {
  456. effectNode.Stop();
  457. }
  458. }
  459. }
  460. this.emitter.StopEmit();
  461. }
  462. public void SetCollisionGoalPos(Transform pos)
  463. {
  464. if (!this.UseCollisionDetection)
  465. {
  466. UnityEngine.Debug.LogWarning(base.gameObject.name + "is not set to collision detect mode, please check it");
  467. return;
  468. }
  469. this.CollisionGoal = pos;
  470. }
  471. public void SetArractionAffectorGoal(Transform goal)
  472. {
  473. if (!this.GravityAffectorEnable || this.GravityAftType == GAFTTYPE.Planar)
  474. {
  475. UnityEngine.Debug.LogWarning(base.gameObject.name + "has no attraction affector, please check it");
  476. return;
  477. }
  478. for (int i = 0; i < this.MaxENodes; i++)
  479. {
  480. EffectNode effectNode = this.AvailableENodes[i];
  481. if (effectNode == null)
  482. {
  483. effectNode = this.ActiveENodes[i];
  484. }
  485. List<Affector> affectorList = effectNode.GetAffectorList();
  486. foreach (Affector affector in affectorList)
  487. {
  488. if (affector.Type == AFFECTORTYPE.GravityAffector)
  489. {
  490. GravityAffector gravityAffector = (GravityAffector)affector;
  491. gravityAffector.SetAttraction(goal);
  492. }
  493. }
  494. }
  495. }
  496. public void SetScale(Vector2 scale)
  497. {
  498. for (int i = 0; i < this.MaxENodes; i++)
  499. {
  500. EffectNode effectNode = this.ActiveENodes[i];
  501. if (effectNode == null)
  502. {
  503. effectNode = this.AvailableENodes[i];
  504. }
  505. effectNode.Scale = scale;
  506. }
  507. }
  508. public void SetColor(Color c)
  509. {
  510. for (int i = 0; i < this.MaxENodes; i++)
  511. {
  512. EffectNode effectNode = this.ActiveENodes[i];
  513. if (effectNode == null)
  514. {
  515. effectNode = this.AvailableENodes[i];
  516. }
  517. effectNode.Color = c;
  518. }
  519. }
  520. public void SetRotation(float angle)
  521. {
  522. for (int i = 0; i < this.MaxENodes; i++)
  523. {
  524. EffectNode effectNode = this.ActiveENodes[i];
  525. if (effectNode == null)
  526. {
  527. effectNode = this.AvailableENodes[i];
  528. }
  529. effectNode.RotateAngle = angle;
  530. }
  531. }
  532. public EffectNode EmitByPos(Vector3 pos)
  533. {
  534. int num = 0;
  535. EffectNode result = null;
  536. for (int i = 0; i < this.MaxENodes; i++)
  537. {
  538. if (num == 1)
  539. {
  540. break;
  541. }
  542. EffectNode effectNode = this.AvailableENodes[i];
  543. if (effectNode != null)
  544. {
  545. this.AddActiveNode(effectNode);
  546. num++;
  547. effectNode.SetLocalPosition(pos);
  548. float life;
  549. if (this.IsNodeLifeLoop)
  550. {
  551. life = -1f;
  552. }
  553. else
  554. {
  555. life = UnityEngine.Random.Range(this.NodeLifeMin, this.NodeLifeMax);
  556. }
  557. Vector3 emitRotation = this.emitter.GetEmitRotation(effectNode);
  558. Color oriColor = this.Color1;
  559. if (this.IsRandomStartColor)
  560. {
  561. oriColor = this.RandomColorGradient.Evaluate(UnityEngine.Random.Range(0f, 1f));
  562. }
  563. effectNode.Init(emitRotation.normalized, this.OriSpeed, life, UnityEngine.Random.Range(this.OriRotationMin, this.OriRotationMax), UnityEngine.Random.Range(this.OriScaleXMin, this.OriScaleXMax), UnityEngine.Random.Range(this.OriScaleYMin, this.OriScaleYMax), oriColor, this.UVTopLeft, this.UVDimension);
  564. result = effectNode;
  565. }
  566. }
  567. return result;
  568. }
  569. public VertexPool Vertexpool;
  570. public Transform ClientTransform;
  571. public bool SyncClient;
  572. public Material Material;
  573. public int RenderType;
  574. public float StartTime;
  575. public float MaxFps = 60f;
  576. public Color DebugColor = Color.white;
  577. public int Depth;
  578. public int SpriteType;
  579. public int OriPoint;
  580. public float SpriteWidth = 1f;
  581. public float SpriteHeight = 1f;
  582. public UV_STRETCH SpriteUVStretch;
  583. public bool RandomOriScale;
  584. public bool RandomOriRot;
  585. public int OriRotationMin;
  586. public int OriRotationMax;
  587. public bool RotAffectorEnable;
  588. public RSTYPE RotateType;
  589. public float DeltaRot;
  590. public AnimationCurve RotateCurve = new AnimationCurve(new Keyframe[]
  591. {
  592. new Keyframe(0f, 0f),
  593. new Keyframe(1f, 360f)
  594. });
  595. public WRAP_TYPE RotateCurveWrap;
  596. public float RotateCurveTime = 1f;
  597. public float RotateCurveMaxValue = 1f;
  598. public AnimationCurve RotateCurve01 = new AnimationCurve(new Keyframe[]
  599. {
  600. new Keyframe(0f, 0f),
  601. new Keyframe(1f, 1f)
  602. });
  603. public float RotateSpeedMin;
  604. public float RotateSpeedMax;
  605. public bool UniformRandomScale;
  606. public float OriScaleXMin = 1f;
  607. public float OriScaleXMax = 1f;
  608. public float OriScaleYMin = 1f;
  609. public float OriScaleYMax = 1f;
  610. public bool ScaleAffectorEnable;
  611. public RSTYPE ScaleType;
  612. public float DeltaScaleX;
  613. public float DeltaScaleY;
  614. public AnimationCurve ScaleXCurve = new AnimationCurve(new Keyframe[]
  615. {
  616. new Keyframe(0f, 1f),
  617. new Keyframe(1f, 5f)
  618. });
  619. public AnimationCurve ScaleYCurve = new AnimationCurve(new Keyframe[]
  620. {
  621. new Keyframe(0f, 1f),
  622. new Keyframe(1f, 5f)
  623. });
  624. public WRAP_TYPE ScaleWrapMode;
  625. public float ScaleCurveTime = 1f;
  626. public float MaxScaleCalue = 1f;
  627. public float MaxScaleValueY = 1f;
  628. public AnimationCurve ScaleXCurveNew = new AnimationCurve(new Keyframe[]
  629. {
  630. new Keyframe(0f, 0f),
  631. new Keyframe(1f, 1f)
  632. });
  633. public AnimationCurve ScaleYCurveNew = new AnimationCurve(new Keyframe[]
  634. {
  635. new Keyframe(0f, 0f),
  636. new Keyframe(1f, 1f)
  637. });
  638. public bool UseSameScaleCurve;
  639. public float DeltaScaleXMax;
  640. public float DeltaScaleYMax;
  641. public bool ColorAffectorEnable;
  642. public int ColorAffectType;
  643. public float ColorGradualTimeLength = 1f;
  644. public COLOR_GRADUAL_TYPE ColorGradualType;
  645. public bool IsRandomStartColor;
  646. public ColorParameter RandomColorParam;
  647. public Gradient RandomColorGradient;
  648. public Color Color1 = Color.white;
  649. public Color Color2;
  650. public Color Color3;
  651. public Color Color4;
  652. public Color Color5;
  653. public COLOR_CHANGE_TYPE ColorChangeType;
  654. public ColorParameter ColorParam;
  655. public Gradient ColorGradient;
  656. public AnimationCurve ColorGradualCurve = new AnimationCurve(new Keyframe[]
  657. {
  658. new Keyframe(0f, 0f),
  659. new Keyframe(1f, 1f)
  660. });
  661. public float RibbonWidth = 1f;
  662. public int MaxRibbonElements = 8;
  663. public float RibbonLen = 15f;
  664. public float TailDistance;
  665. public bool SyncTrailWithClient;
  666. public UV_STRETCH RibbonUVStretch;
  667. public bool FaceToObject;
  668. public Transform FaceObject;
  669. public bool UseRandomRibbon;
  670. public float RibbonWidthMin = 1f;
  671. public float RibbonWidthMax = 1f;
  672. public float RibbonLenMin = 15f;
  673. public float RibbonLenMax = 15f;
  674. public Vector2 ConeSize = new Vector2(1f, 3f);
  675. public float ConeAngle;
  676. public int ConeSegment = 12;
  677. public bool UseConeAngleChange;
  678. public AnimationCurve ConeDeltaAngle = new AnimationCurve(new Keyframe[]
  679. {
  680. new Keyframe(0f, 0f),
  681. new Keyframe(1f, 60f)
  682. });
  683. public Mesh CMesh;
  684. public Vector3 MeshRotateAxis = Vector3.up;
  685. public int EmitType;
  686. public Vector3 BoxSize;
  687. public Vector3 EmitPoint;
  688. public float Radius = 1f;
  689. public bool UseRandomCircle;
  690. public float CircleRadiusMin = 1f;
  691. public float CircleRadiusMax = 10f;
  692. public Vector3 CircleDir = Vector3.up;
  693. public bool EmitUniform;
  694. public Transform LineStartObj;
  695. public Transform LineEndObj;
  696. public int MaxENodes = 1;
  697. public bool IsNodeLifeLoop = true;
  698. public float NodeLifeMin = 1f;
  699. public float NodeLifeMax = 1f;
  700. public EEmitWay EmitWay;
  701. public XCurveParam EmitterCurveX;
  702. public float DiffDistance = 0.1f;
  703. public Mesh EmitMesh;
  704. public int EmitMeshType;
  705. public bool IsBurstEmit;
  706. public float ChanceToEmit = 100f;
  707. public float EmitDuration = 100f;
  708. public float EmitRate = 20f;
  709. public int EmitLoop = -1;
  710. public DIRECTION_TYPE DirType;
  711. public Vector3 OriVelocityAxis = Vector3.up;
  712. public int AngleAroundAxis;
  713. public bool UseRandomDirAngle;
  714. public int AngleAroundAxisMax;
  715. public float OriSpeed;
  716. public bool AlwaysSyncRotation;
  717. public bool IsRandomSpeed;
  718. public float SpeedMin;
  719. public float SpeedMax;
  720. public bool JetAffectorEnable;
  721. public MAGTYPE JetMagType;
  722. public float JetMag;
  723. public AnimationCurve JetCurve;
  724. public XCurveParam JetCurveX;
  725. public bool VortexAffectorEnable;
  726. public MAGTYPE VortexMagType;
  727. public float VortexMag = 1f;
  728. public XCurveParam VortexCurveX;
  729. public AnimationCurve VortexCurve;
  730. public Vector3 VortexDirection = Vector3.up;
  731. public bool VortexInheritRotation = true;
  732. public Transform VortexObj;
  733. public bool IsFixedCircle;
  734. public bool IsRandomVortexDir;
  735. public bool IsVortexAccelerate;
  736. public float VortexAttenuation;
  737. public bool UseVortexMaxDistance;
  738. public float VortexMaxDistance;
  739. public bool UVRotAffectorEnable;
  740. public bool RandomUVRotateSpeed;
  741. public float UVRotXSpeed;
  742. public float UVRotYSpeed;
  743. public float UVRotXSpeedMax;
  744. public float UVRotYSpeedMax;
  745. public Vector2 UVRotStartOffset = Vector2.zero;
  746. public bool UVScaleAffectorEnable;
  747. public float UVScaleXSpeed;
  748. public float UVScaleYSpeed;
  749. public bool GravityAffectorEnable;
  750. public GAFTTYPE GravityAftType;
  751. public MAGTYPE GravityMagType;
  752. public float GravityMag;
  753. public AnimationCurve GravityCurve;
  754. public XCurveParam GravityCurveX;
  755. public Vector3 GravityDirection = Vector3.up;
  756. public Transform GravityObject;
  757. public bool IsGravityAccelerate = true;
  758. public bool AirAffectorEnable;
  759. public Transform AirObject;
  760. public MAGTYPE AirMagType;
  761. public float AirMagnitude;
  762. public AnimationCurve AirMagCurve;
  763. public XCurveParam AirMagCurveX;
  764. public Vector3 AirDirection = Vector3.up;
  765. public float AirAttenuation;
  766. public bool AirUseMaxDistance;
  767. public float AirMaxDistance;
  768. public bool AirEnableSpread;
  769. public float AirSpread;
  770. public float AirInheritVelocity;
  771. public bool AirInheritRotation;
  772. public bool BombAffectorEnable;
  773. public Transform BombObject;
  774. public BOMBTYPE BombType = BOMBTYPE.Spherical;
  775. public BOMBDECAYTYPE BombDecayType;
  776. public float BombMagnitude;
  777. public Vector3 BombAxis;
  778. public float BombDecay;
  779. public bool TurbulenceAffectorEnable;
  780. public Transform TurbulenceObject;
  781. public MAGTYPE TurbulenceMagType;
  782. public float TurbulenceMagnitude = 1f;
  783. public XCurveParam TurbulenceMagCurveX;
  784. public AnimationCurve TurbulenceMagCurve;
  785. public float TurbulenceAttenuation;
  786. public bool TurbulenceUseMaxDistance;
  787. public float TurbulenceMaxDistance;
  788. public Vector3 TurbulenceForce = Vector3.one;
  789. public bool DragAffectorEnable;
  790. public Transform DragObj;
  791. public bool DragUseDir;
  792. public Vector3 DragDir = Vector3.up;
  793. public float DragMag = 10f;
  794. public bool DragUseMaxDist;
  795. public float DragMaxDist = 50f;
  796. public float DragAtten;
  797. public bool UVAffectorEnable;
  798. public int UVType;
  799. public Vector2 OriTopLeftUV = Vector2.zero;
  800. public Vector2 OriUVDimensions = Vector2.one;
  801. protected Vector2 UVTopLeft;
  802. protected Vector2 UVDimension;
  803. public int Cols = 1;
  804. public int Rows = 1;
  805. public int LoopCircles = -1;
  806. public float UVTime = 1f;
  807. public string EanPath = "none";
  808. public int EanIndex;
  809. public bool RandomStartFrame;
  810. public bool UseCollisionDetection;
  811. public float ParticleRadius = 1f;
  812. public COLLITION_TYPE CollisionType;
  813. public bool CollisionAutoDestroy = true;
  814. public Transform EventReceiver;
  815. public string EventHandleFunctionName = " ";
  816. public Transform CollisionGoal;
  817. public float ColliisionPosRange;
  818. public LayerMask CollisionLayer;
  819. public Vector3 PlaneDir = Vector3.up;
  820. public Vector3 PlaneOffset = new Vector3(0f, -10f, 0f);
  821. protected Plane mCollisionPlane;
  822. public float RopeWidth = 1f;
  823. public float RopeUVLen = 5f;
  824. public bool RopeFixUVLen = true;
  825. public bool SineAffectorEnable;
  826. public MAGTYPE SineMagType;
  827. public float SineMagnitude = 1f;
  828. public float SineTime = 1f;
  829. public XCurveParam SineMagCurveX;
  830. public Vector3 SineForce = Vector3.up;
  831. public bool SineIsAccelarate;
  832. public bool UseShaderCurve1;
  833. public bool UseShaderCurve2;
  834. public XCurveParam ShaderCurveX1;
  835. public XCurveParam ShaderCurveX2;
  836. protected ulong TotalAddedCount;
  837. public bool UseSubEmitters;
  838. public XffectCache SpawnCache;
  839. public string BirthSubEmitter;
  840. public string CollisionSubEmitter;
  841. public string DeathSubEmitter;
  842. public bool SubEmitterAutoStop = true;
  843. public Emitter emitter;
  844. public EffectNode[] AvailableENodes;
  845. public EffectNode[] ActiveENodes;
  846. public int AvailableNodeCount;
  847. public Vector3 LastClientPos;
  848. public XffectComponent Owner;
  849. public bool mStopped;
  850. public RopeData RopeDatas = new RopeData();
  851. }
  852. }