23 lines
466 B
C#
23 lines
466 B
C#
using Assets.Scripts;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class GoodCoinScript : MonoBehaviour
|
|
{
|
|
[SerializeField] float SpawningChance = 1f;
|
|
|
|
private bool objectEnabled;
|
|
private void Awake()
|
|
{
|
|
objectEnabled = DataBearer.Instance.Rules.BonusCoins && Random.value < SpawningChance;
|
|
|
|
if (!objectEnabled)
|
|
{
|
|
Destroy(gameObject);
|
|
return;
|
|
}
|
|
|
|
}
|
|
}
|