补充参战防御塔进入战斗逻辑
- 将 Inventory 中参战的防御塔数据传递到 CombatSelectForm 中 - 为防御塔的图标展示添加 TowerRepoItem 与 TowerIconArea 适配防御塔的三层 Image
This commit is contained in:
@@ -42,6 +42,19 @@ namespace GeometryTD.UI
|
||||
}
|
||||
|
||||
public void SetBuildAction(int buildIndex, Func<bool> buildAction, int cost, Sprite icon = null)
|
||||
{
|
||||
SetBuildAction(buildIndex, buildAction, cost, icon, false, Color.white, Color.white, Color.white);
|
||||
}
|
||||
|
||||
public void SetBuildAction(
|
||||
int buildIndex,
|
||||
Func<bool> buildAction,
|
||||
int cost,
|
||||
Sprite icon,
|
||||
bool useTowerLayers,
|
||||
Color baseColor,
|
||||
Color bearingColor,
|
||||
Color muzzleColor)
|
||||
{
|
||||
if (buildIndex < 0 || buildIndex >= _buildOptions.Length)
|
||||
{
|
||||
@@ -54,6 +67,10 @@ namespace GeometryTD.UI
|
||||
option.Icon = icon;
|
||||
option.IsGain = false;
|
||||
option.IsVisible = true;
|
||||
option.UseTowerLayers = useTowerLayers;
|
||||
option.BaseColor = baseColor;
|
||||
option.BearingColor = bearingColor;
|
||||
option.MuzzleColor = muzzleColor;
|
||||
}
|
||||
|
||||
public void SetBuildAction(int buildIndex, Action buildAction, int cost, Sprite icon = null)
|
||||
@@ -75,6 +92,16 @@ namespace GeometryTD.UI
|
||||
icon);
|
||||
}
|
||||
|
||||
public void SetBuildVisible(int buildIndex, bool visible)
|
||||
{
|
||||
if (buildIndex < 0 || buildIndex >= _buildOptions.Length)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_buildOptions[buildIndex].IsVisible = visible;
|
||||
}
|
||||
|
||||
public void SetUpgradeAction(Func<bool> upgradeAction, int cost, Sprite icon = null)
|
||||
{
|
||||
_upgradeOption.Action = upgradeAction;
|
||||
@@ -82,6 +109,7 @@ namespace GeometryTD.UI
|
||||
_upgradeOption.Icon = icon;
|
||||
_upgradeOption.IsGain = false;
|
||||
_upgradeOption.IsVisible = true;
|
||||
_upgradeOption.UseTowerLayers = false;
|
||||
}
|
||||
|
||||
public void SetUpgradeAction(Action upgradeAction, int cost, Sprite icon = null)
|
||||
@@ -109,6 +137,7 @@ namespace GeometryTD.UI
|
||||
_destroyOption.Icon = icon;
|
||||
_destroyOption.IsGain = true;
|
||||
_destroyOption.IsVisible = true;
|
||||
_destroyOption.UseTowerLayers = false;
|
||||
}
|
||||
|
||||
public void SetDestroyAction(Action destroyAction, int gain, Sprite icon = null)
|
||||
@@ -278,7 +307,11 @@ namespace GeometryTD.UI
|
||||
IsVisible = option.IsVisible,
|
||||
IsInteractable = option.Action != null && CanExecute(option, currentCoin),
|
||||
ActionType = option.ActionType,
|
||||
ActionIndex = option.ActionIndex
|
||||
ActionIndex = option.ActionIndex,
|
||||
UseTowerLayers = option.UseTowerLayers,
|
||||
BaseColor = option.BaseColor,
|
||||
BearingColor = option.BearingColor,
|
||||
MuzzleColor = option.MuzzleColor
|
||||
};
|
||||
}
|
||||
|
||||
@@ -293,6 +326,10 @@ namespace GeometryTD.UI
|
||||
public bool IsVisible = true;
|
||||
public Sprite Icon;
|
||||
public Func<bool> Action;
|
||||
public bool UseTowerLayers;
|
||||
public Color BaseColor = Color.white;
|
||||
public Color BearingColor = Color.white;
|
||||
public Color MuzzleColor = Color.white;
|
||||
|
||||
public Option(CombatSelectActionType actionType, int actionIndex, bool requiresAffordable)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user