diff options
Diffstat (limited to 'Thronefall_v1.0/Decompile/PerkDestroyGameObjectModifyer.cs')
-rw-r--r-- | Thronefall_v1.0/Decompile/PerkDestroyGameObjectModifyer.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Thronefall_v1.0/Decompile/PerkDestroyGameObjectModifyer.cs b/Thronefall_v1.0/Decompile/PerkDestroyGameObjectModifyer.cs new file mode 100644 index 0000000..db48c28 --- /dev/null +++ b/Thronefall_v1.0/Decompile/PerkDestroyGameObjectModifyer.cs @@ -0,0 +1,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); + } + } +} |