Elin Modding Docs Doc
Loading...
Searching...
No Matches
EffectMeteor.cs
1using System;
2using System.Collections.Generic;
3using DG.Tweening;
4using DG.Tweening.Core;
5using DG.Tweening.Plugins.Options;
6using UnityEngine;
7
8// Token: 0x02000120 RID: 288
9public class EffectMeteor : Effect
10{
11 // Token: 0x060007CE RID: 1998 RVA: 0x000326FC File Offset: 0x000308FC
12 public override void OnPlay()
13 {
14 this.sr.enabled = true;
15 this.aniExplosion.SetActive(false);
16 this.destV = this.fromV;
17 this.fromV += this.startPos + this.startPos.Random() * 0.2f;
18 base.transform.position = this.fromV;
19 this.moveTween = base.transform.DOMove(this.destV, this.time, false).SetEase(Ease.Linear).SetDelay(this.startDelay).OnComplete(delegate
20 {
21 this.sr.enabled = false;
22 this.aniExplosion.SetActive(true);
23 this.destPos.Animate(AnimeID.Dig, true);
24 Action onComplete = this.onComplete;
25 if (onComplete != null)
26 {
27 onComplete();
28 }
29 EMono.Sound.Play("explode", this.destV, 1f);
30 Shaker.ShakeCam("meteor", 1f);
31 });
32 }
33
34 // Token: 0x060007CF RID: 1999 RVA: 0x000327B0 File Offset: 0x000309B0
35 public static void Create(Point center, int radius, int count, Action<int, Point> onComplete)
36 {
37 List<Point> list = new List<Point>();
38 for (int i = 0; i < count; i++)
39 {
40 Point p = center.Copy();
41 Effect effect = Effect.Get("meteor");
42 effect.startDelay = Rand.Range(0f, 0.5f);
43 if (radius > 0)
44 {
45 int num = 0;
46 if (num < 1000)
47 {
48 Point randomSurface = EMono._map.GetRandomSurface(center.x, center.z, radius, true, false);
49 foreach (Point obj in list)
50 {
51 randomSurface.Equals(obj);
52 }
53 p.Set(randomSurface);
54 list.Add(randomSurface);
55 }
56 }
57 int _i = i;
58 effect.onComplete = delegate()
59 {
60 onComplete(_i, p);
61 };
62 effect.Play(p, 0f, null, null);
63 }
64 }
65
66 // Token: 0x040007DD RID: 2013
67 public Animator aniExplosion;
68
69 // Token: 0x040007DE RID: 2014
70 public Vector3 startPos;
71
72 // Token: 0x040007DF RID: 2015
73 public float time;
74}
Definition EMono.cs:6
Definition Point.cs:11