summaryrefslogtreecommitdiff
path: root/Thronefall_1_57/Thronefall/Thronefall/PerkIndestructible.cs
blob: 0cb04c719387fe5a348c1448d087cb825c00d118 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using UnityEngine;

public class PerkIndestructible : MonoBehaviour
{
	[SerializeField]
	private Equippable indestructiblePerk;

	private void Start()
	{
		if (PerkManager.IsEquipped(indestructiblePerk))
		{
			TaggedObject componentInChildren = GetComponentInChildren<TaggedObject>();
			if ((bool)componentInChildren)
			{
				componentInChildren.RemoveTag(TagManager.ETag.PlayerOwned);
			}
		}
		Object.Destroy(this);
	}
}