-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCoinDrop.txt
108 lines (97 loc) · 2.82 KB
/
CoinDrop.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// dnSpy decompiler from Assembly-CSharp.dll
using System;
using UnityEngine;
using UnityEngine.UI;
public class CoinDrop : MonoBehaviour
{
private void Start()
{
GameObject gameObject = base.transform.GetChild(0).gameObject;
this.animator = gameObject.GetComponent<Animator>();
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;
}
if (this.coinNum == 0)
{
this.animator.Play("drop_left");
}
else if (this.coinNum == 1)
{
this.animator.Play("drop_straight");
}
else
{
this.animator.Play("drop_right");
}
}
this.spawnCounter += Time.deltaTime;
if (this.spawnCounter >= 2.5f)
{
if (this.coinNum == 1)
{
if (GameManager.Instance.settingsCombatTexts)
{
GameObject poolObject = UIManager.Instance.getPoolObject(UIManager.Instance.poolGoldText);
if (poolObject != null)
{
UtilityMethods.MoveUiElementToWorldPosition(poolObject.GetComponent<RectTransform>(), base.transform.position + new Vector3(0f, -0.5f, 0f));
Text component = poolObject.GetComponent<Text>();
component.color = UIManager.colorYellow;
if (!this.isBoss)
{
component.fontSize = 20;
}
else
{
component.fontSize = 24;
}
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.poolGoldDropParticles);
if (poolObject2 != null)
{
poolObject2.transform.position = base.transform.position + new Vector3(0f, -0.5f, 0f);
ParticleSystem component2 = poolObject2.GetComponent<ParticleSystem>();
poolObject2.SetActive(true);
component2.Play();
}
}
SoundManager.Instance.playCoin();
}
this.initObject();
}
}
public int coinNum;
public bool isBoss;
public double coinAmt;
public Enemy fromEnemy;
private bool shouldInit = true;
private float spawnCounter;
private Animator animator;
private SpriteRenderer spriteRenderer;
}