投降问题
This commit is contained in:
parent
42add47b2a
commit
9767122433
@ -825,6 +825,7 @@ MonoBehaviour:
|
||||
CityInfoConnectTxt: {fileID: 4284740271896731992}
|
||||
UnitInfoArea: {fileID: 2480805605976873671}
|
||||
UnitPreview: {fileID: 1574824826172591212}
|
||||
HeroBG: {fileID: 8542972478569400351}
|
||||
SkillArea: {fileID: 5103894093500615785}
|
||||
UnitInfoTitle: {fileID: 5947855050418965474}
|
||||
UnitInfoDesc: {fileID: 6268898721485590865}
|
||||
@ -1331,6 +1332,81 @@ MonoBehaviour:
|
||||
WordSpacing: 0
|
||||
LineSpacing: 0
|
||||
ParagraphSpacing: 0
|
||||
--- !u!1 &2184567251560438232
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6696902709199148190}
|
||||
- component: {fileID: 5966834031676836008}
|
||||
- component: {fileID: 8542972478569400351}
|
||||
m_Layer: 5
|
||||
m_Name: HeroBG
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6696902709199148190
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2184567251560438232}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4139685850248483818}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: -136, y: -362}
|
||||
m_SizeDelta: {x: 1085.4991, y: 22.984}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!222 &5966834031676836008
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2184567251560438232}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &8542972478569400351
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2184567251560438232}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0.16078432}
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 84204e2179d0fe74f93c41e95b86af83, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 1
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &2239098147206037608
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1524,6 +1600,7 @@ RectTransform:
|
||||
- {fileID: 6140180938121102967}
|
||||
- {fileID: 1927385823728150020}
|
||||
- {fileID: 196265501413848608}
|
||||
- {fileID: 6696902709199148190}
|
||||
m_Father: {fileID: 1504026315933255359}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
@ -3294,7 +3371,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 147, y: -23}
|
||||
m_SizeDelta: {x: 0, y: 32.0265}
|
||||
m_SizeDelta: {x: 120.01, y: 32.0265}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5182836495056545005
|
||||
CanvasRenderer:
|
||||
@ -4214,7 +4291,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 250, y: -480.093}
|
||||
m_AnchoredPosition: {x: 250, y: -550.093}
|
||||
m_SizeDelta: {x: 500, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &4676610239985244751
|
||||
@ -4882,7 +4959,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 250, y: -550.093}
|
||||
m_AnchoredPosition: {x: 250, y: -785.093}
|
||||
m_SizeDelta: {x: 500, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1555931548957767936
|
||||
|
||||
@ -1099,11 +1099,13 @@ namespace Logic.Action
|
||||
public virtual bool CompleteExecute(CommonActionParams actionParams)
|
||||
{
|
||||
// 此处限制了只有在当前 Player 回合内才能执行对应Player的Action
|
||||
if (actionParams.PlayerId != 0 && ActionId.ActionType != CommonActionType.TurnStart &&
|
||||
actionParams.MapData.CurPlayer != null && actionParams.MapData.CurPlayer.Id != actionParams.PlayerId)
|
||||
if (actionParams.PlayerId != 0
|
||||
&& ActionId.ActionType != CommonActionType.TurnStart
|
||||
&& ActionId.ActionType != CommonActionType.PlayerSurrender
|
||||
&& actionParams.MapData.CurPlayer != null && actionParams.MapData.CurPlayer.Id != actionParams.PlayerId)
|
||||
{
|
||||
LogSystem.LogError($"CompleteExecute Player 不一致 {ActionId.GetStringLog()}");
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
if (Main.Instance.IsNetActionExecuting)
|
||||
|
||||
@ -98,8 +98,9 @@ namespace TH1_Logic.Steam
|
||||
message.ActionData.Param.MapData = Main.MapData;
|
||||
message.ActionData.Param.RefreshParams();
|
||||
|
||||
if (message.ActionData.ActionId.ActionType != CommonActionType.TurnStart &&
|
||||
Main.MapData.CurPlayer != null && Main.MapData.CurPlayer.Id != message.ActionData.Param.PlayerId)
|
||||
if (message.ActionData.ActionId.ActionType != CommonActionType.TurnStart
|
||||
&& message.ActionData.ActionId.ActionType != CommonActionType.PlayerSurrender
|
||||
&& Main.MapData.CurPlayer != null && Main.MapData.CurPlayer.Id != message.ActionData.Param.PlayerId)
|
||||
{
|
||||
LogSystem.LogError($"OnReceivedActionConfirm Player 不一致");
|
||||
return;
|
||||
@ -146,8 +147,9 @@ namespace TH1_Logic.Steam
|
||||
|
||||
message.ActionData.Param.MapData = Main.MapData;
|
||||
message.ActionData.Param.RefreshParams();
|
||||
if (message.ActionData.ActionId.ActionType != CommonActionType.TurnStart &&
|
||||
Main.MapData.CurPlayer != null && Main.MapData.CurPlayer.Id != message.ActionData.Param.PlayerId)
|
||||
if (message.ActionData.ActionId.ActionType != CommonActionType.TurnStart
|
||||
&& message.ActionData.ActionId.ActionType != CommonActionType.PlayerSurrender
|
||||
&& Main.MapData.CurPlayer != null && Main.MapData.CurPlayer.Id != message.ActionData.Param.PlayerId)
|
||||
{
|
||||
LogSystem.LogError($"OnReceivedActionExcute Player 不一致");
|
||||
return;
|
||||
|
||||
@ -65,6 +65,7 @@ namespace TH1_UI.View.Info
|
||||
[Header("UnitInfo相关")]
|
||||
public GameObject UnitInfoArea;
|
||||
public Image UnitPreview;
|
||||
public Image HeroBG;
|
||||
public GameObject SkillArea;
|
||||
public TextMeshProUGUI UnitInfoTitle;
|
||||
public TextMeshProUGUI UnitInfoDesc;
|
||||
@ -387,18 +388,31 @@ namespace TH1_UI.View.Info
|
||||
if (evt.type != UIGridInfoType.unit || !Main.MapData.UnitMap.GetUnitDataByUnitId(evt.id, out var unitData))
|
||||
{
|
||||
UnitInfoArea.SetActive(false);
|
||||
if (HeroBG != null) HeroBG.gameObject.SetActive(false);
|
||||
return;
|
||||
}
|
||||
UnitInfoArea.SetActive(true);
|
||||
// 获取关联数据
|
||||
Main.MapData.GetPlayerDataByUnitId(unitData.Id, out var playerData);
|
||||
Table.Instance.UnitTypeDataAssets.GetUnitTypeInfo(unitData.UnitFullType, out var unitTypeInfo);
|
||||
|
||||
// Step #1: Unit Preview
|
||||
|
||||
// Step #1: Unit Preview
|
||||
if (Table.Instance.UnitTypeDataAssets.GetUnitSprite(Main.MapData, unitData, out var spr))
|
||||
UnitPreview.sprite = spr;
|
||||
|
||||
|
||||
|
||||
// HeroBG: Giant单位且在Library中有Illustration时显示
|
||||
if (HeroBG != null)
|
||||
{
|
||||
LibraryGiantData libData = null;
|
||||
bool showHeroBG = unitData.UnitType is UnitType.Giant or UnitType.GiantJuggernaut
|
||||
&& unitData.GiantType != GiantType.None
|
||||
&& Table.Instance.LibraryDataAssets.GetLibraryInfoByGiant(unitData.GiantType, out libData)
|
||||
&& libData.Illust != null;
|
||||
HeroBG.gameObject.SetActive(showHeroBG);
|
||||
if (showHeroBG)
|
||||
HeroBG.sprite = libData.Illust;
|
||||
}
|
||||
|
||||
// Step #2: Title & Description
|
||||
// 逻辑参考 BottomInfoUI.cs -> UpdateInfoUnit
|
||||
string title = MultilingualManager.Instance.GetMultilingualTextSafe(unitTypeInfo.Name);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user