关卡详情UI

main
pengjunwu 2024-02-20 15:54:14 +08:00
parent d896b79747
commit 7a8fbfcd81
9 changed files with 51 additions and 57 deletions

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: f081a71d8e950ad41b971b3c68c02918
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -18,7 +18,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &2496527073058313689
RectTransform:
m_ObjectHideFlags: 0
@ -347,7 +347,7 @@ GameObject:
m_Component:
- component: {fileID: 58778236225763723}
m_Layer: 5
m_Name: BeforeFight
m_Name: UI_LevelDetail
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -1185,7 +1185,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &8359026589096777047
RectTransform:
m_ObjectHideFlags: 0
@ -2217,7 +2217,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &7862012220007327710
RectTransform:
m_ObjectHideFlags: 0
@ -7021,7 +7021,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &2138620985188177337
RectTransform:
m_ObjectHideFlags: 0
@ -9023,7 +9023,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0.0050736293, y: -0.0020121713}
m_AnchoredPosition: {x: 0.0000702289, y: -0.0020121713}
m_SizeDelta: {x: 0, y: 200}
m_Pivot: {x: 0, y: 1}
--- !u!1 &7878160611327203694

View File

@ -75,7 +75,7 @@ public partial class UIManager
_WindowMeta(UINameConst.UI_GetItemSettle,UIWindowLayer.Normal);
_WindowMeta(UINameConst.UI_Patio, UIWindowLayer.Normal);
_WindowMeta(UINameConst.UI_BuyDiamond, UIWindowLayer.Normal);
_WindowMeta(UINameConst.BeforeFight, UIWindowLayer.Normal);
_WindowMeta(UINameConst.UI_LevelDetail, UIWindowLayer.Normal);
_WindowMeta(UINameConst.UINoticeTwo, UIWindowLayer.Waiting);
}
@ -170,6 +170,6 @@ public static class UINameConst
public static readonly string UI_Camp = "Camp/UI_Camp";
public static readonly string UI_Patio = "MainScene/Raffle/UI_Patio";
public static readonly string UI_BuyDiamond = "Interface/Shop/UI_BuyDiamond";
public static readonly string BeforeFight = "LevelSelect/NewLevelPannel/BeforeFight";
public static readonly string UI_LevelDetail = "LevelSelect/UI_LevelDetailController";
}

View File

@ -10,10 +10,10 @@ using Image = UnityEngine.UI.Image;
using Toggle = UnityEngine.UI.Toggle;
using ScrollView = PhxhSDK.PhxhScrollView;
public class BeforeFightBinder
public class UI_LevelDetailBinder
{
public static void GetComponents(BeforeFightController window)
public static void GetComponents(UI_LevelDetailController window)
{
window.Image_BG = window.GetComponent<Image>("Image_BG");
window.Button_Close = window.GetComponent<Button>("Image_BG/Top/Button_Close");

View File

@ -30,7 +30,7 @@ public class RewardForBeforeFightUI : Reward
}
public class BeforeFightController : UIWindow
public class UI_LevelDetailController : UIWindow
{
//UI GameObj
///Auto Gen Start///
@ -69,12 +69,12 @@ public class BeforeFightController : UIWindow
public TMP_Text Text_StartFight;
public LevelInfo curLevelInfo;
private LevelInfo _currLevelInfo;
PhxhScrollView _mCurrentScrollView = null;
private Button fightBtn;
public List<RewardForBeforeFightUI> allRewards;
private int _currTeamIndex = -1;
//private int _currTeamIndex = -1;
private Team _currTeam;
private int _teamIndexMax;
///Auto Gen End///
@ -88,7 +88,7 @@ public class BeforeFightController : UIWindow
public override void OnInit()
{
//bind UI GameObj
BeforeFightBinder.GetComponents(this);
UI_LevelDetailBinder.GetComponents(this);
_mCurrentScrollView = GetComponent<PhxhScrollView>("Image_BG/RewardAndSweep/Text_GetReward/PhxhScrollView");
fightBtn = GetComponent<Button>("Image_BG/Image_StartFight");
Text_LevelNum = GetComponent<TMP_Text>("Image_BG/Top/Text_LevelNum");
@ -101,14 +101,16 @@ public class BeforeFightController : UIWindow
private void FightOnClick()
{
var team = TeamEditManager.Instance.TeamList[_currTeamIndex];
if (team.IsMemberEmpty())
{
return;
}
LevelManager.Instance.TryEnterLevel(curLevelInfo.ID, OnEnterLevelFinished);
// var team = TeamEditManager.Instance.TeamList[_currTeamIndex];
// if (team.IsMemberEmpty())
// {
// return;
// }
//
// LevelManager.Instance.TryEnterLevel(_currLevelInfo.ID, OnEnterLevelFinished);
UIManager.Instance.OpenWindow(UINameConst.UI_BeforeFight,_currLevelInfo.ID);
}
private void OnEnterLevelFinished()
{
CloseWindow();
@ -121,10 +123,10 @@ public class BeforeFightController : UIWindow
//invoke when open window
protected override void OnShowWindow(object data)
{
curLevelInfo = data as LevelInfo;
_currLevelInfo = data as LevelInfo;
allRewards = new List<RewardForBeforeFightUI>();
InitTeamInfo();
//InitTeamInfo();
RefreshUI();
RefreshAllRewardsData();
@ -133,19 +135,19 @@ public class BeforeFightController : UIWindow
CommonUtils.SetImageBlur(GetComponent<Image>("blurObj"));
}
private void InitTeamInfo()
{
var teamList = TeamEditManager.Instance.TeamList;
_teamIndexMax = teamList.Count - 1;
_currTeam = _currTeamIndex == -1 ? TeamEditManager.Instance.GetSelectTeam() : teamList[_currTeamIndex];
if (_currTeam == null)
{
DebugUtil.LogError("当前没有任何编队!");
return;
}
_currTeamIndex = teamList.IndexOf(_currTeam);
}
// private void InitTeamInfo()
// {
// var teamList = TeamEditManager.Instance.TeamList;
// _teamIndexMax = teamList.Count - 1;
// _currTeam = _currTeamIndex == -1 ? TeamEditManager.Instance.GetSelectTeam() : teamList[_currTeamIndex];
// if (_currTeam == null)
// {
// DebugUtil.LogError("当前没有任何编队!");
// return;
// }
//
// _currTeamIndex = teamList.IndexOf(_currTeam);
// }
private void RefreshScrollview()
{
@ -154,23 +156,23 @@ public class BeforeFightController : UIWindow
private async void RefreshUI()
{
Text_LevelNum.text = curLevelInfo.ChapterIndex + "-" + curLevelInfo.LevelIndex;
Text_LevelName.text = curLevelInfo.Name;
Text_Buff.text = curLevelInfo.EnvironmentBuffString;
Image_DayOrNight.sprite= await CommonUtils.GetDayNightIcon(curLevelInfo.DayNightType);
Text_LevelNum.text = _currLevelInfo.ChapterIndex + "-" + _currLevelInfo.LevelIndex;
Text_LevelName.text = _currLevelInfo.Name;
Text_Buff.text = _currLevelInfo.EnvironmentBuffString;
Image_DayOrNight.sprite= await CommonUtils.GetDayNightIcon(_currLevelInfo.DayNightType);
//Text_DayOrNight.text = CommonUtils.GetDayNightString(curLevelInfo.DayNightType);
Image_weather.sprite=await CommonUtils.GetWeatherIcon(curLevelInfo.WeatherType);
Text_WeatherAndLand01.text = CommonUtils.GetLocalizeText(TableManager.Instance.Tables.WeatherConfig.Get((int)curLevelInfo.WeatherType).NameLocal);
Image_environment.sprite=await CommonUtils.GetEnvironmentIcon(curLevelInfo.EnvironmentType);
Text_WeatherAndLand02.text = CommonUtils.GetLocalizeText(TableManager.Instance.Tables.EnviormentConfig.Get((int)curLevelInfo.EnvironmentType).NameLocal);
Image_weather.sprite=await CommonUtils.GetWeatherIcon(_currLevelInfo.WeatherType);
Text_WeatherAndLand01.text = CommonUtils.GetLocalizeText(TableManager.Instance.Tables.WeatherConfig.Get((int)_currLevelInfo.WeatherType).NameLocal);
Image_environment.sprite=await CommonUtils.GetEnvironmentIcon(_currLevelInfo.EnvironmentType);
Text_WeatherAndLand02.text = CommonUtils.GetLocalizeText(TableManager.Instance.Tables.EnviormentConfig.Get((int)_currLevelInfo.EnvironmentType).NameLocal);
for (int i = 0; i < 3; i++)
{
GameObject go = FindObj(string.Format("Image_BG/LevelDetail/Image_Misson/ImageMissionBar{0}", (i).ToString()));
if(i<curLevelInfo.LevelData.starTarget.Count)
if(i<_currLevelInfo.LevelData.starTarget.Count)
{
go.SetActive(true);
CommonUtils.GetComponent<TMP_Text>(go, "TextDescribe").text = curLevelInfo.GetStarTargetLocalizationText(i);
CommonUtils.GetComponent<TMP_Text>(go, "TextDescribe").text = _currLevelInfo.GetStarTargetLocalizationText(i);
int diamondCount = GetDiamondRewardNum((i+1));
TMP_Text getItemText = CommonUtils.GetComponent<TMP_Text>(go, "TextGetItem");
TMP_Text getItemGrayText = CommonUtils.GetComponent<TMP_Text>(go, "TextGetItem_Grey");
@ -225,7 +227,7 @@ public class BeforeFightController : UIWindow
private void RefreshAllRewardsData()
{
DataLevel dataLevel = TableManager.Instance.Tables.Level.Get(curLevelInfo.ID);
DataLevel dataLevel = TableManager.Instance.Tables.Level.Get(_currLevelInfo.ID);
for (int i = 0; i < dataLevel.NormalRewardID.Length; i++)
{
Reward reward= RewardManager.Instance.Get(dataLevel.NormalRewardID[i]);
@ -266,7 +268,7 @@ public class BeforeFightController : UIWindow
private int GetDiamondRewardNum(int index)//返回0表示显示文本但是不显示数量返回-1表示不显示文本
{
DataLevel levelCfg = TableManager.Instance.Tables.Level.Get(curLevelInfo.ID);
DataLevel levelCfg = TableManager.Instance.Tables.Level.Get(_currLevelInfo.ID);
int[] rewardId=null;
int diamondNum = 0;
switch (index)

View File

@ -557,7 +557,7 @@ public class UI_LevelSelectController : UIWindow
if (_currSelectLevelInfo.IsStory)
LevelManager.Instance.TryEnterLevel(_currSelectLevelInfo.ID);
else
UIManager.Instance.OpenWindow(UINameConst.UI_BeforeFight, _currSelectLevelInfo.ID);
UIManager.Instance.OpenWindow(UINameConst.UI_LevelDetail, _currSelectLevelInfo);
//LevelManager.Instance.TryEnterLevel(_currSelectLevelInfo.ID, CloseSelf);
}