Projet-IA-Madelaine/Scripts/GameObjectsScripts/BadCoinScript.cs
2024-06-12 21:03:42 +02:00

22 lines
458 B
C#

using Assets.Scripts;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BadCoinScript : MonoBehaviour
{
[SerializeField] float SpawnChance = 1f;
private bool objectEnabled;
private void Awake()
{
objectEnabled = DataBearer.Instance.Rules.MalusCoins && Random.value < SpawnChance;
if (!objectEnabled)
{
Destroy(gameObject);
return;
}
}
}