mirror of
https://github.com/Earth-Genesis-Games/Ajedrez_Purgatorio.git
synced 2026-09-11 09:47:35 +00:00
fix: ReadOnlyPropertyDrawer + BoardManager skips PlacePieces in campaign mode
I1: ReadOnlyDrawer shows [ReadOnly] fields as greyed out in Inspector I2: BoardManager.Start() skips PlacePieces() when CampaignManager is active (SetupBoard will place pieces instead)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// PropertyDrawer for ReadOnlyAttribute. Shows fields as disabled (greyed out) in the Inspector.
|
||||
/// </summary>
|
||||
[CustomPropertyDrawer(typeof(ReadOnlyAttribute))]
|
||||
public class ReadOnlyDrawer : PropertyDrawer
|
||||
{
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
GUI.enabled = false;
|
||||
EditorGUI.PropertyField(position, property, label);
|
||||
GUI.enabled = true;
|
||||
}
|
||||
}
|
||||
@@ -57,8 +57,11 @@ public GameObject kingPrefab; // Prefab del Rey usado como "jefe" en el purgator
|
||||
GenerateBoard();
|
||||
GenerateIndicators();
|
||||
|
||||
// Setup estándar (puede ser reemplazado por SetupBoard con CampaignState)
|
||||
PlacePieces();
|
||||
// Skip standard piece placement if CampaignManager will call SetupBoard
|
||||
if (CampaignManager.Instance == null || !CampaignManager.Instance.IsCampaignActive)
|
||||
{
|
||||
PlacePieces();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user