Elin Modding Docs Doc
Loading...
Searching...
No Matches
EffectIRenderer.cs
1using System;
2using UnityEngine;
3
4// Token: 0x0200011E RID: 286
5public class EffectIRenderer : Effect
6{
7 // Token: 0x060007C5 RID: 1989 RVA: 0x00032284 File Offset: 0x00030484
8 public EffectIRenderer Play(Card _card, Card _origin, Vector3 _to)
9 {
10 if (!EMono.core.IsGameStarted)
11 {
12 base.Kill();
13 return null;
14 }
15 this.card = _card;
16 this.origin = _origin;
17 this.destV = _to;
18 this.from = _origin.pos.Copy();
19 this.snapTimer = -0.01f;
20 base.Activate();
21 this.OnUpdate();
22 if (this.animeData)
23 {
24 this.anime = new TransAnime
25 {
26 data = this.animeData,
27 renderer = this.card.renderer
28 }.Init();
29 }
30 return this;
31 }
32
33 // Token: 0x060007C6 RID: 1990 RVA: 0x00032320 File Offset: 0x00030520
34 public EffectIRenderer Play(Card _card, Point from, Point to = null, float fixY = 0f)
35 {
36 this.card = _card;
37 this.snapTimer = -0.01f;
38 this.from = from.Copy();
39 base.Play(from, fixY, to, null);
40 if (this.animeData)
41 {
42 this.anime = new TransAnime
43 {
44 data = this.animeData,
45 renderer = this.card.renderer
46 }.Init();
47 }
48 return this;
49 }
50
51 // Token: 0x060007C7 RID: 1991 RVA: 0x00032394 File Offset: 0x00030594
52 public override void OnUpdate()
53 {
54 RenderParam renderParam = this.card.GetRenderParam();
55 renderParam.color = (float)EMono.scene.screenElin.tileMap.GetApproximateBlocklight(this.from.cell);
56 this.timer += Core.delta;
57 this.snapTimer -= Core.delta;
58 TransAnime transAnime = this.anime;
59 if (transAnime != null)
60 {
61 transAnime.Update();
62 }
63 if (this.snapTimer < 0f || this.v == Vector3.zero)
64 {
65 if (this.follow)
66 {
67 if (this.origin.renderer != null)
68 {
69 Vector3 position = this.origin.renderer.position;
70 Vector3 vector = this.destV * this.timer / this.duration * this.speed;
71 this.v.x = position.x + this.posFix.x + vector.x;
72 this.v.y = position.y + this.posFix.y + vector.y;
73 this.v.z = position.z + this.posFix.z + vector.z;
74 }
75 }
76 else
77 {
78 this.v.x = base.transform.position.x;
79 this.v.y = base.transform.position.y;
80 this.v.z = base.transform.position.z;
81 }
82 if (this.anime != null)
83 {
84 this.v.x = this.v.x + this.anime.v.x;
85 this.v.y = this.v.y + this.anime.v.y;
86 this.v.z = this.v.z + this.anime.v.z;
87 }
88 this.snapTimer += this.snapInterval;
89 }
90 renderParam.x = this.v.x;
91 renderParam.y = this.v.y;
92 renderParam.z = this.v.x;
93 this.card.renderer.skip = true;
94 if (this.card.renderer.usePass)
95 {
96 this.card.renderer.data.Draw(renderParam);
97 return;
98 }
99 if (this.card.renderer.actor)
100 {
101 this.card.renderer.actor.OnRender(renderParam);
102 }
103 }
104
105 // Token: 0x040007D1 RID: 2001
106 public Card card;
107
108 // Token: 0x040007D2 RID: 2002
109 public Card origin;
110
111 // Token: 0x040007D3 RID: 2003
112 public Point from;
113
114 // Token: 0x040007D4 RID: 2004
115 public float snapInterval;
116
117 // Token: 0x040007D5 RID: 2005
118 public bool follow;
119
120 // Token: 0x040007D6 RID: 2006
121 public TransAnimeData animeData;
122
123 // Token: 0x040007D7 RID: 2007
124 public TransAnime anime;
125
126 // Token: 0x040007D8 RID: 2008
127 private float snapTimer;
128
129 // Token: 0x040007D9 RID: 2009
130 private Vector3 v;
131}
Definition Card.cs:13
Definition EMono.cs:6
Definition Point.cs:11