Adjust GameVariables

This commit is contained in:
2025-12-18 18:13:31 +08:00
parent 3956a6ffab
commit aae09b5696
3 changed files with 9 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 9f37e854902a46cb8bd927cf84ab450c, type: 3}
m_Name: GameVariables
m_EditorClassIdentifier:
debugMode: 0
bgTilePrefabs: {fileID: 2914066502361773997, guid: 3f39182b81f944a4d93213431acb41c3,
type: 3}
gemsPrefabs:
@@ -63,7 +64,7 @@ MonoBehaviour:
bombExplodeSfx: {fileID: 8300000, guid: 9dcc9b1297952c446a5571fdb2fb7a2f, type: 3}
bombDelay: 2
bombRadius: 2
dropHeight: 3
dropHeight: 2
gemSpeed: 5
scoreSpeed: 3
cascadeDelayMs: 150

View File

@@ -4,6 +4,10 @@ using UnityEngine;
namespace ScriptableObjects {
[CreateAssetMenu(fileName = "GameVariables", menuName = "Game Variables")]
public class GameVariables : ScriptableObject {
[Header("Debug")]
[Tooltip("Turns Gem switching on/off")]
public bool debugMode;
[Header("Prefabs")]
public GameObject bgTilePrefabs;
public GemTypeValues[] gemsPrefabs;

View File

@@ -215,6 +215,9 @@ namespace Services {
/// </param>
/// <returns></returns>
public void TrySwitch(Vector2Int position) {
if (!this.gameVariables.debugMode)
return;
Gem gem = this.gameBoard.GetGemAt(position);
if(gem == null)
return;