-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGoldChest.txt
88 lines (79 loc) · 2.36 KB
/
GoldChest.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// dnSpy decompiler from Assembly-CSharp.dll
using System;
using UnityEngine;
using UnityEngine.UI;
public class GoldChest : MonoBehaviour
{
private void Start()
{
GameObject gameObject = base.transform.GetChild(0).gameObject;
this.spriteRenderer = gameObject.transform.GetChild(0).gameObject.GetComponent<SpriteRenderer>();
}
private void initObject()
{
this.shouldInit = true;
this.spawnCounter = 0f;
base.gameObject.SetActive(false);
}
private void Update()
{
if (GameManager.Instance.prestigePause)
{
return;
}
if (this.shouldInit)
{
this.shouldInit = false;
if (this.fromEnemy != null && this.spriteRenderer != null)
{
this.spriteRenderer.sortingLayerName = this.fromEnemy.spriteRender0.sortingLayerName;
}
}
this.spawnCounter += Time.deltaTime;
if (this.spawnCounter >= 2.5f)
{
if (GameManager.Instance.settingsCombatTexts)
{
GameObject poolObject = UIManager.Instance.getPoolObject(UIManager.Instance.poolGoldText);
if (poolObject != null)
{
UtilityMethods.MoveUiElementToWorldPosition(poolObject.GetComponent<RectTransform>(), base.transform.position);
Text component = poolObject.GetComponent<Text>();
component.color = UIManager.colorYellow;
if (!this.isBoss)
{
component.fontSize = 22;
}
else
{
component.fontSize = 26;
}
component.text = "+" + UIManager.Instance.convertNumberFormat(this.coinAmt.ToString("0"));
poolObject.SetActive(true);
}
}
GameManager.Instance.goldAmt += this.coinAmt;
AchievementManager.Instance.listAch[16].currAmt += this.coinAmt;
AchievementManager.Instance.checkIfAchComplete(16);
if (GameManager.Instance.settingsParticleEffects)
{
GameObject poolObject2 = UIManager.Instance.getPoolObject(UIManager.Instance.poolChestDropParticles);
if (poolObject2 != null)
{
poolObject2.transform.position = base.transform.position;
ParticleSystem component2 = poolObject2.GetComponent<ParticleSystem>();
poolObject2.SetActive(true);
component2.Play();
}
}
SoundManager.Instance.playChest();
this.initObject();
}
}
public bool isBoss;
public double coinAmt;
public Enemy fromEnemy;
private bool shouldInit = true;
private float spawnCounter;
private SpriteRenderer spriteRenderer;
}