summaryrefslogtreecommitdiff
path: root/Thronefall_v1.0/Decompile/PracticeTargetCoinDrop.cs
blob: 760d9c23a58162abef12abe831a101e6aecd0e56 (plain)
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
using UnityEngine;

public class PracticeTargetCoinDrop : MonoBehaviour
{
	private Hp hp;

	private TagManager tagManager;

	[SerializeField]
	private int totalCoinsToDrop = 3;

	private void Start()
	{
		hp = GetComponent<Hp>();
		tagManager = TagManager.instance;
	}

	private void Update()
	{
		if (tagManager.CountAllTaggedObjectsWithTag(TagManager.ETag.PracticeTargets) <= totalCoinsToDrop)
		{
			hp.coinCount = 1;
		}
	}

	private void OnDestroy()
	{
		if ((bool)hp && hp.HpValue <= 0f)
		{
			AchievementManager.UnlockAchievement(AchievementManager.Achievements.START_TUTORIAL);
		}
	}
}