Builds
Documents
Scripts
GameHandlers
GameObjectsScripts
BadCoinScript.cs
FinishLineScript.cs
GoodCoinScript.cs
LaserScript.cs
MissileAlertScript.cs
MissileScript.cs
ObstaclePatternBehaviour.cs
PlayerScript.cs
ScorePannelScript.cs
Helpers
MainMenuUI
Objects
PlayerBehaviourScripts
Spawners
Statistics
README.md
SingletonMB.cs
README.md
22 lines
458 B
C#
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;
|
|
}
|
|
}
|
|
}
|