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

Public Member Functions

void PlaySound (string id=null)
 
void Deactivate ()
 

Public Attributes

Hoard.Item item
 
RigidUpdate[] updates
 
float shadowY
 
int shadow
 
bool paired
 
bool active = true
 
bool hasSound
 
Rigidbody2D rb
 

Private Member Functions

void OnCollisionEnter2D (Collision2D collision)
 

Additional Inherited Members

- Static Public Member Functions inherited from EMono
static int rnd (int a)
 
- Static Public Attributes inherited from EMono
static Core core
 
- Properties inherited from EMono
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 4 of file CollectibleActor.cs.

Member Function Documentation

◆ Deactivate()

void CollectibleActor.Deactivate ( )
inline

Definition at line 50 of file CollectibleActor.cs.

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 }
RigidUpdate[] updates

References active, RigidUpdate.active, and updates.

Referenced by RigidExplode.OnFixedUpdate().

◆ OnCollisionEnter2D()

void CollectibleActor.OnCollisionEnter2D ( Collision2D  collision)
inlineprivate

Definition at line 28 of file CollectibleActor.cs.

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 }
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

References hasSound, Hoard.hiScore, Player.hoard, item, Hoard.maxSounds, EMono.player, rb, Hoard.score, EMono.Sound, and Hoard.volume.

◆ PlaySound()

void CollectibleActor.PlaySound ( string  id = null)
inline

Definition at line 42 of file CollectibleActor.cs.

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 }

References Player.hoard, item, EMono.player, rb, EMono.Sound, and Hoard.volume.

Referenced by HoardActor.FixedUpdate().

Member Data Documentation

◆ active

bool CollectibleActor.active = true

Definition at line 20 of file CollectibleActor.cs.

Referenced by Deactivate(), and HoardActor.Update().

◆ hasSound

bool CollectibleActor.hasSound

Definition at line 23 of file CollectibleActor.cs.

Referenced by OnCollisionEnter2D().

◆ item

Hoard.Item CollectibleActor.item

◆ paired

bool CollectibleActor.paired

Definition at line 17 of file CollectibleActor.cs.

Referenced by HoardActor.Activate().

◆ rb

Rigidbody2D CollectibleActor.rb

Definition at line 26 of file CollectibleActor.cs.

Referenced by HoardActor.FixedUpdate(), OnCollisionEnter2D(), and PlaySound().

◆ shadow

int CollectibleActor.shadow

Definition at line 14 of file CollectibleActor.cs.

Referenced by HoardActor.Update().

◆ shadowY

float CollectibleActor.shadowY

Definition at line 11 of file CollectibleActor.cs.

Referenced by HoardActor.Update().

◆ updates

RigidUpdate [] CollectibleActor.updates

Definition at line 8 of file CollectibleActor.cs.

Referenced by HoardActor.Activate(), and Deactivate().


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