Elin Modding Docs Doc
Loading...
Searching...
No Matches
CollectibleActor.cs
1using System;
2using UnityEngine;
3
4// Token: 0x02000515 RID: 1301
5public class CollectibleActor : EMono
6{
7 // Token: 0x060022F1 RID: 8945 RVA: 0x000C3A5C File Offset: 0x000C1C5C
8 private void OnCollisionEnter2D(Collision2D collision)
9 {
10 Hoard hoard = EMono.player.hoard;
11 hoard.score++;
12 if (hoard.score > hoard.hiScore)
13 {
14 hoard.hiScore = hoard.score;
15 }
16 if (!this.hasSound || hoard.maxSounds == 0)
17 {
18 return;
19 }
20 if (this.rb.velocity.magnitude > 0.8f && this.rb.position.y < 3f)
21 {
22 EMono.Sound.Play(this.item.Source.sound, this.rb.position, 0.01f * (float)hoard.volume);
23 }
24 }
25
26 // Token: 0x060022F2 RID: 8946 RVA: 0x000C3B18 File Offset: 0x000C1D18
27 public void PlaySound(string id = null)
28 {
29 if (this.rb.position.y < 10f)
30 {
31 return;
32 }
33 EMono.Sound.Play(id.IsEmpty(this.item.Source.sound), this.rb.position, 0.01f * (float)EMono.player.hoard.volume);
34 }
35
36 // Token: 0x060022F3 RID: 8947 RVA: 0x000C3B84 File Offset: 0x000C1D84
37 public void Deactivate()
38 {
39 base.gameObject.SetActive(false);
40 this.active = false;
41 RigidUpdate[] array = this.updates;
42 for (int i = 0; i < array.Length; i++)
43 {
44 array[i].active = false;
45 }
46 }
47
48 // Token: 0x04001250 RID: 4688
49 public Hoard.Item item;
50
51 // Token: 0x04001251 RID: 4689
52 public RigidUpdate[] updates;
53
54 // Token: 0x04001252 RID: 4690
55 [NonSerialized]
56 public float shadowY;
57
58 // Token: 0x04001253 RID: 4691
59 [NonSerialized]
60 public int shadow;
61
62 // Token: 0x04001254 RID: 4692
63 [NonSerialized]
64 public bool paired;
65
66 // Token: 0x04001255 RID: 4693
67 [NonSerialized]
68 public bool active = true;
69
70 // Token: 0x04001256 RID: 4694
71 [NonSerialized]
72 public bool hasSound;
73
74 // Token: 0x04001257 RID: 4695
75 [NonSerialized]
76 public Rigidbody2D rb;
77}
Definition EMono.cs:6
Definition Hoard.cs:10