4public class Shaker : MonoBehaviour
6 public static void Shake(Transform t,
string id,
float magnitude)
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
16 t.localPosition = Vector3.zero;
20 public static void Shake(Component t,
string id,
float magnitude = 1f)
22 Shake(t.transform,
id, magnitude);
25 public static void ShakeCam(
string id =
"default",
float magnitude = 1f)
27 if ((
bool)Camera.main)
29 Shake(Camera.main.transform.parent,
id, magnitude);
static void ShakeCam(string id="default", float magnitude=1f)
static void Shake(Component t, string id, float magnitude=1f)
static void Shake(Transform t, string id, float magnitude)