Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
Shaker Class Reference
Inheritance diagram for Shaker:

Static Public Member Functions

static void Shake (Transform t, string id, float magnitude)
 
static void Shake (Component t, string id, float magnitude=1f)
 
static void ShakeCam (string id="default", float magnitude=1f)
 

Detailed Description

Definition at line 4 of file Shaker.cs.

Member Function Documentation

◆ Shake() [1/2]

static void Shaker.Shake ( Component  t,
string  id,
float  magnitude = 1f 
)
inlinestatic

Definition at line 20 of file Shaker.cs.

21 {
22 Shake(t.transform, id, magnitude);
23 }
static void Shake(Transform t, string id, float magnitude)
Definition: Shaker.cs:6

References Shake().

◆ Shake() [2/2]

static void Shaker.Shake ( Transform  t,
string  id,
float  magnitude 
)
inlinestatic

Definition at line 6 of file Shaker.cs.

7 {
8 DOTween.Kill(t);
9 ShakerProfile shakerProfile = ResourceCache.Load<ShakerProfile>("Media/Effect/ScreenEffect/Shaker/" + id);
10 int num = ((Random.Range(0, 2) == 0) ? 1 : (-1));
11 int num2 = ((Random.Range(0, 2) == 0) ? 1 : (-1));
12 _ = t.transform.localPosition;
13 t.transform.localPosition = Vector3.zero;
14 ((shakerProfile.type == ShakerProfile.Type.Shake) ? t.DOShakePosition(shakerProfile.duration, new Vector2((float)num * shakerProfile.power, (float)num2 * shakerProfile.power) * magnitude, shakerProfile.vibrato) : t.DOPunchPosition(new Vector2((float)num * shakerProfile.power, (float)num2 * shakerProfile.power) * magnitude, shakerProfile.duration, shakerProfile.vibrato, shakerProfile.elasticity)).OnComplete(delegate
15 {
16 t.localPosition = Vector3.zero;
17 });
18 }

References ShakerProfile.duration, ShakerProfile.elasticity, ShakerProfile.power, Random, and ShakerProfile.vibrato.

Referenced by Shake(), and ShakeCam().

◆ ShakeCam()

static void Shaker.ShakeCam ( string  id = "default",
float  magnitude = 1f 
)
inlinestatic

Definition at line 25 of file Shaker.cs.

26 {
27 if ((bool)Camera.main)
28 {
29 Shake(Camera.main.transform.parent, id, magnitude);
30 }
31 }

References Shake().

Referenced by GameDate.AdvanceHour(), TraitTrap.OnActivateTrap(), EffectMeteor.OnPlay(), DramaManager.ParseLine(), ActEffect.ProcAt(), and ShakerProfile.ShakeCam().


The documentation for this class was generated from the following file: