Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
CollectibleActor.cs
Go to the documentation of this file.
1using System;
2using UnityEngine;
3
4public class CollectibleActor : EMono
5{
7
9
10 [NonSerialized]
11 public float shadowY;
12
13 [NonSerialized]
14 public int shadow;
15
16 [NonSerialized]
17 public bool paired;
18
19 [NonSerialized]
20 public bool active = true;
21
22 [NonSerialized]
23 public bool hasSound;
24
25 [NonSerialized]
26 public Rigidbody2D rb;
27
28 private void OnCollisionEnter2D(Collision2D collision)
29 {
30 Hoard hoard = EMono.player.hoard;
31 hoard.score++;
32 if (hoard.score > hoard.hiScore)
33 {
34 hoard.hiScore = hoard.score;
35 }
36 if (hasSound && hoard.maxSounds != 0 && rb.velocity.magnitude > 0.8f && rb.position.y < 3f)
37 {
38 EMono.Sound.Play(item.Source.sound, rb.position, 0.01f * (float)hoard.volume);
39 }
40 }
41
42 public void PlaySound(string id = null)
43 {
44 if (!(rb.position.y < 10f))
45 {
46 EMono.Sound.Play(id.IsEmpty(item.Source.sound), rb.position, 0.01f * (float)EMono.player.hoard.volume);
47 }
48 }
49
50 public void Deactivate()
51 {
52 base.gameObject.SetActive(value: false);
53 active = false;
54 RigidUpdate[] array = updates;
55 for (int i = 0; i < array.Length; i++)
56 {
57 array[i].active = false;
58 }
59 }
60}
void PlaySound(string id=null)
void OnCollisionEnter2D(Collision2D collision)
RigidUpdate[] updates
Definition: EMono.cs:4
static Player player
Definition: EMono.cs:11
static SoundManager Sound
Definition: EMono.cs:39
Definition: Hoard.cs:8
int score
Definition: Hoard.cs:130
int maxSounds
Definition: Hoard.cs:121
int hiScore
Definition: Hoard.cs:127
int volume
Definition: Hoard.cs:124
Hoard hoard
Definition: Player.cs:892