Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ScreenFlash.cs
Go to the documentation of this file.
1using DG.Tweening;
2using UnityEngine;
3
4public class ScreenFlash : ScriptableObject
5{
6 private static Tween tween;
7
8 public static Color currentColor;
9
10 public static Color clearColor = new Color(0f, 0f, 0f, 0f);
11
12 public Color color;
13
14 public AnimationCurve ease;
15
16 public float duration;
17
18 public static void Reset()
19 {
20 TweenUtil.KillTween(ref tween);
22 }
23
24 public static void Play(string id, float mtp = 1f)
25 {
26 ResourceCache.Load<ScreenFlash>("Media/Effect/ScreenEffect/Flash/" + id).Play(mtp);
27 }
28
29 public void Play(float mtp = 1f)
30 {
31 TweenUtil.KillTween(ref tween);
32 tween = DOTween.To(() => currentColor, delegate(Color x)
33 {
34 currentColor = x;
35 }, color * mtp, duration).SetEase(ease).OnComplete(delegate
36 {
37 Reset();
38 });
39 }
40}
static void Reset()
Definition: ScreenFlash.cs:18
static Tween tween
Definition: ScreenFlash.cs:6
AnimationCurve ease
Definition: ScreenFlash.cs:14
static Color clearColor
Definition: ScreenFlash.cs:10
static Color currentColor
Definition: ScreenFlash.cs:8
static void Play(string id, float mtp=1f)
Definition: ScreenFlash.cs:24
Color color
Definition: ScreenFlash.cs:12
float duration
Definition: ScreenFlash.cs:16
void Play(float mtp=1f)
Definition: ScreenFlash.cs:29