blob: db48c28a0aa9ec63b75cff73f04198b425d4551d (
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
|
using UnityEngine;
public class PerkDestroyGameObjectModifyer : MonoBehaviour
{
[SerializeField]
private Equippable perk;
[SerializeField]
private bool destroyIfPerkIsEquipped;
[SerializeField]
private bool destroyIfPerkIsNotEquipped;
private void Start()
{
if (PerkManager.IsEquipped(perk))
{
if (destroyIfPerkIsEquipped)
{
Object.Destroy(base.gameObject);
}
}
else if (destroyIfPerkIsNotEquipped)
{
Object.Destroy(base.gameObject);
}
}
}
|