M0 回合制战斗壳层:接口与单局状态、调试入口、暂停联动
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public sealed class BattleActorCardItem : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject activeMarker;
|
||||
[SerializeField] private Image icon;
|
||||
[SerializeField] private Image hpFill;
|
||||
[SerializeField] private Image mpFill;
|
||||
[SerializeField] private TextMeshProUGUI characterName;
|
||||
[SerializeField] private TextMeshProUGUI hpText;
|
||||
[SerializeField] private TextMeshProUGUI mpText;
|
||||
|
||||
public GameObject ActiveMarker => activeMarker;
|
||||
public Image Icon => icon;
|
||||
public Image HpFill => hpFill;
|
||||
public Image MpFill => mpFill;
|
||||
public TextMeshProUGUI CharacterName => characterName;
|
||||
public TextMeshProUGUI HpText => hpText;
|
||||
public TextMeshProUGUI MpText => mpText;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public void ConfigureEditor(GameObject marker, Image iconImage, Image hpFillImage, Image mpFillImage,
|
||||
TextMeshProUGUI nameLabel, TextMeshProUGUI hpLabel, TextMeshProUGUI mpLabel)
|
||||
{
|
||||
activeMarker = marker;
|
||||
icon = iconImage;
|
||||
hpFill = hpFillImage;
|
||||
mpFill = mpFillImage;
|
||||
characterName = nameLabel;
|
||||
hpText = hpLabel;
|
||||
mpText = mpLabel;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 084cbeaade555447b83112b1c528e263
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,37 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public sealed class BattleEnemySlotItem : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Button targetButton;
|
||||
[SerializeField] private GameObject selectedMarker;
|
||||
[SerializeField] private Image icon;
|
||||
[SerializeField] private Image hpFill;
|
||||
[SerializeField] private TextMeshProUGUI enemyName;
|
||||
[SerializeField] private TextMeshProUGUI hpText;
|
||||
|
||||
public Button TargetButton => targetButton;
|
||||
public GameObject SelectedMarker => selectedMarker;
|
||||
public Image Icon => icon;
|
||||
public Image HpFill => hpFill;
|
||||
public TextMeshProUGUI EnemyName => enemyName;
|
||||
public TextMeshProUGUI HpText => hpText;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public void ConfigureEditor(Button button, GameObject marker, Image iconImage, Image hpFillImage,
|
||||
TextMeshProUGUI nameLabel, TextMeshProUGUI hpLabel)
|
||||
{
|
||||
targetButton = button;
|
||||
selectedMarker = marker;
|
||||
icon = iconImage;
|
||||
hpFill = hpFillImage;
|
||||
enemyName = nameLabel;
|
||||
hpText = hpLabel;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8efb693fb8da3406ea05e81cb56a6c20
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,64 @@
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// 战斗界面逻辑(手写 partial,与自动生成的 BattleForm.cs 合并)。
|
||||
/// 首版为半透明壳层:只负责展示快照、收集指令与占位反馈;
|
||||
/// 不修改战斗数据、不读取存档、不决定掉落,也不承担暂停地图计时等流程职责。
|
||||
/// 暂停地图更新由单局流程(RunBattleCoordinator / 探索层)负责。
|
||||
/// </summary>
|
||||
public partial class BattleForm : UGuiForm
|
||||
{
|
||||
protected override void OnInit(object userData)
|
||||
{
|
||||
base.OnInit(userData);
|
||||
|
||||
View.attackButton.onClick.AddListener(OnAttackButtonClick);
|
||||
View.skillButton.onClick.AddListener(OnSkillButtonClick);
|
||||
View.itemButton.onClick.AddListener(OnItemButtonClick);
|
||||
View.escapeButton.onClick.AddListener(OnEscapeButtonClick);
|
||||
|
||||
// 道具行动保留但首版禁用,不产生 BattleCommand
|
||||
View.itemButton.interactable = false;
|
||||
}
|
||||
|
||||
protected override void OnOpen(object userData)
|
||||
{
|
||||
base.OnOpen(userData);
|
||||
|
||||
View.currentActorText.text = string.Empty;
|
||||
Log.Info("BattleForm opened as empty shell.");
|
||||
}
|
||||
|
||||
protected override void OnClose(bool isShutdown, object userData)
|
||||
{
|
||||
View.attackButton.onClick.RemoveListener(OnAttackButtonClick);
|
||||
View.skillButton.onClick.RemoveListener(OnSkillButtonClick);
|
||||
View.itemButton.onClick.RemoveListener(OnItemButtonClick);
|
||||
View.escapeButton.onClick.RemoveListener(OnEscapeButtonClick);
|
||||
|
||||
base.OnClose(isShutdown, userData);
|
||||
}
|
||||
|
||||
private void OnAttackButtonClick()
|
||||
{
|
||||
Log.Info("BattleForm placeholder: attack clicked.");
|
||||
}
|
||||
|
||||
private void OnSkillButtonClick()
|
||||
{
|
||||
Log.Info("BattleForm placeholder: skill clicked.");
|
||||
}
|
||||
|
||||
private void OnItemButtonClick()
|
||||
{
|
||||
Log.Info("BattleForm placeholder: item clicked.");
|
||||
}
|
||||
|
||||
private void OnEscapeButtonClick()
|
||||
{
|
||||
Log.Info("BattleForm placeholder: escape clicked.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 090bea621c85436a8cbe0ad03aa94ebb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class BattleForm : UGuiForm
|
||||
{
|
||||
[SerializeField] private BattleView _view = null;
|
||||
|
||||
public BattleView View => _view;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9442df9c5d6124f96a96de27d76fc7e3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,27 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public sealed class BattleTurnSlotItem : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject activeMarker;
|
||||
[SerializeField] private Image icon;
|
||||
[SerializeField] private TextMeshProUGUI label;
|
||||
|
||||
public GameObject ActiveMarker => activeMarker;
|
||||
public Image Icon => icon;
|
||||
public TextMeshProUGUI Label => label;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public void ConfigureEditor(GameObject marker, Image iconImage, TextMeshProUGUI slotLabel)
|
||||
{
|
||||
activeMarker = marker;
|
||||
icon = iconImage;
|
||||
label = slotLabel;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8703508b1b1894f67aeb402ef5b11113
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,23 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class BattleView : MonoBehaviour
|
||||
{
|
||||
[SerializeField] public global::UnityEngine.RectTransform turnSlotsRoot;
|
||||
[SerializeField] public global::SepCore.UI.BattleTurnSlotItem battleTurnSlotTemplate;
|
||||
[SerializeField] public global::SepCore.UI.BattleActorCardItem playerCard1;
|
||||
[SerializeField] public global::SepCore.UI.BattleActorCardItem playerCard2;
|
||||
[SerializeField] public global::SepCore.UI.BattleActorCardItem playerCard3;
|
||||
[SerializeField] public global::SepCore.UI.BattleActorCardItem playerCard4;
|
||||
[SerializeField] public global::UnityEngine.UI.HorizontalLayoutGroup enemySlotsRoot;
|
||||
[SerializeField] public global::SepCore.UI.BattleEnemySlotItem battleEnemySlotTemplate;
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI currentActorText;
|
||||
[SerializeField] public global::UnityEngine.UI.Button attackButton;
|
||||
[SerializeField] public global::UnityEngine.UI.Button skillButton;
|
||||
[SerializeField] public global::UnityEngine.UI.Button itemButton;
|
||||
[SerializeField] public global::UnityEngine.UI.Button escapeButton;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da8c2ddc0d704496db8c9d57244ecca9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user