|
|
@@ -62,7 +62,9 @@ namespace Fort23.Mono
|
|
|
int itemid = 0;
|
|
|
for (int i = 0; i < sentimentDataSentimentProperty.level; i++)
|
|
|
{
|
|
|
- int level1 = sentimentData.sentimentProperties[0].level <= 0 ? 1 : sentimentData.sentimentProperties[0].level;
|
|
|
+ int level1 = sentimentData.sentimentProperties[0].level <= 0
|
|
|
+ ? 1
|
|
|
+ : sentimentData.sentimentProperties[0].level;
|
|
|
int conFigId1 = sentimentData.sentimentProperties[0].groupId * 10 + level1;
|
|
|
var sentimentEffectConfig1 = ConfigComponent.Instance.Get<SentimentEffectConfig>(conFigId1);
|
|
|
itemid = sentimentEffectConfig1.upConstItemId;
|
|
|
@@ -79,7 +81,13 @@ namespace Fort23.Mono
|
|
|
{
|
|
|
sentimentEffectWidget.CustomInit(sentimentEffectWidget.sentimentProperty);
|
|
|
}
|
|
|
+
|
|
|
+ foreach (var sentimentEffectWidget in sentimentEffectWidgets)
|
|
|
+ {
|
|
|
+ sentimentEffectWidget.UpdateXian();
|
|
|
+ }
|
|
|
|
|
|
+ UpdateRestBtn();
|
|
|
AccountFileInfo.Instance.SavePlayerData();
|
|
|
});
|
|
|
Btn_LingWu.onClick.AddListener(() =>
|
|
|
@@ -89,7 +97,9 @@ namespace Fort23.Mono
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if (currentSentimentEffectWidget.lastSentimentWidget != null && currentSentimentEffectWidget.lastSentimentWidget.sentimentProperty.level < currentSentimentEffectWidget.sentimentEffectConfig.unlockLevel)
|
|
|
+ if (currentSentimentEffectWidget.lastSentimentWidget != null &&
|
|
|
+ currentSentimentEffectWidget.lastSentimentWidget.sentimentProperty.level <
|
|
|
+ currentSentimentEffectWidget.sentimentEffectConfig.unlockLevel)
|
|
|
{
|
|
|
TipMessagePanel.OpenTipMessagePanel("前置节点没有解锁");
|
|
|
AudioManager.Instance.PlayAudio("ui_chaozuoshibai.wav");
|
|
|
@@ -105,14 +115,17 @@ namespace Fort23.Mono
|
|
|
|
|
|
int level = curretnSentimentProperty.level <= 0 ? 1 : curretnSentimentProperty.level;
|
|
|
int conFigId = curretnSentimentProperty.groupId * 100 + level + 1;
|
|
|
- SentimentEffectConfig sentimentEffectConfig = ConfigComponent.Instance.Get<SentimentEffectConfig>(conFigId);
|
|
|
+ SentimentEffectConfig sentimentEffectConfig =
|
|
|
+ ConfigComponent.Instance.Get<SentimentEffectConfig>(conFigId);
|
|
|
|
|
|
- if (PlayerManager.Instance.BagController.DeductItem(sentimentEffectConfig.upConstItemId, sentimentEffectConfig.upConstCount))
|
|
|
+ if (PlayerManager.Instance.BagController.DeductItem(sentimentEffectConfig.upConstItemId,
|
|
|
+ sentimentEffectConfig.upConstCount))
|
|
|
{
|
|
|
ItemSourcePanel.OpenPanel(sentimentEffectConfig.upConstItemId);
|
|
|
AudioManager.Instance.PlayAudio("ui_chaozuoshibai.wav");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
AudioManager.Instance.PlayAudio("ui_tycg.wav");
|
|
|
|
|
|
curretnSentimentProperty.level++;
|
|
|
@@ -125,6 +138,7 @@ namespace Fort23.Mono
|
|
|
sentimentEffectWidget.UpdateXian();
|
|
|
}
|
|
|
|
|
|
+ UpdateRestBtn();
|
|
|
UpdateUi();
|
|
|
currentSentimentEffectWidget.CustomInit(curretnSentimentProperty);
|
|
|
});
|
|
|
@@ -154,12 +168,16 @@ namespace Fort23.Mono
|
|
|
{
|
|
|
sentimentData = uiData[0] as AccountFileInfo.SentimentData;
|
|
|
_sentimentEffectConfigs = ConfigComponent.Instance.GetAll<SentimentEffectConfig>().ToList();
|
|
|
- mainSentimentEffectWidget = await UIManager.Instance.CreateGComponentForObject<SentimentEffectWidget>(MainSentimentEffectWidget, null);
|
|
|
+ mainSentimentEffectWidget =
|
|
|
+ await UIManager.Instance.CreateGComponentForObject<SentimentEffectWidget>(MainSentimentEffectWidget,
|
|
|
+ null);
|
|
|
mainSentimentEffectWidget.CustomInit(sentimentData.mainSentiment);
|
|
|
mainSentimentEffectWidget.OnClick = OnClick;
|
|
|
|
|
|
|
|
|
- int level1 = sentimentData.sentimentProperties[0].level <= 0 ? 1 : sentimentData.sentimentProperties[0].level;
|
|
|
+ int level1 = sentimentData.sentimentProperties[0].level <= 0
|
|
|
+ ? 1
|
|
|
+ : sentimentData.sentimentProperties[0].level;
|
|
|
int conFigId1 = sentimentData.sentimentProperties[0].groupId * 10 + level1;
|
|
|
var sentimentEffectConfig1 = ConfigComponent.Instance.Get<SentimentEffectConfig>(conFigId1);
|
|
|
if (_titlePanel == null)
|
|
|
@@ -193,7 +211,8 @@ namespace Fort23.Mono
|
|
|
var sentimentEffectConfig = ConfigComponent.Instance.Get<SentimentEffectConfig>(conFigId);
|
|
|
int index = MapNumber(sentimentEffectConfig.pos);
|
|
|
|
|
|
- SentimentEffectWidget sentimentEffectWidget1 = await UIManager.Instance.CreateGComponent<SentimentEffectWidget>(null, Root[index]);
|
|
|
+ SentimentEffectWidget sentimentEffectWidget1 =
|
|
|
+ await UIManager.Instance.CreateGComponent<SentimentEffectWidget>(null, Root[index]);
|
|
|
sentimentEffectWidget1.CustomInit(sentimentDataSentimentProperty);
|
|
|
sentimentEffectWidget1.OnClick = OnClick;
|
|
|
|
|
|
@@ -204,6 +223,8 @@ namespace Fort23.Mono
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ UpdateRestBtn();
|
|
|
+
|
|
|
foreach (var rectTransform in Root)
|
|
|
{
|
|
|
LayoutRebuilder.ForceRebuildLayoutImmediate(rectTransform);
|
|
|
@@ -212,7 +233,9 @@ namespace Fort23.Mono
|
|
|
|
|
|
foreach (var sentimentEffectWidget in sentimentEffectWidgets)
|
|
|
{
|
|
|
- int level = sentimentEffectWidget.sentimentProperty.level <= 0 ? 1 : sentimentEffectWidget.sentimentProperty.level;
|
|
|
+ int level = sentimentEffectWidget.sentimentProperty.level <= 0
|
|
|
+ ? 1
|
|
|
+ : sentimentEffectWidget.sentimentProperty.level;
|
|
|
int conFigId = sentimentEffectWidget.sentimentProperty.groupId * 10 + level;
|
|
|
var sentimentEffectConfig = ConfigComponent.Instance.Get<SentimentEffectConfig>(conFigId);
|
|
|
SentimentEffectWidget sentimentEffectWidget1 = null;
|
|
|
@@ -222,25 +245,43 @@ namespace Fort23.Mono
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- sentimentEffectWidget1 = sentimentEffectWidgets.FirstOrDefault(s => s.sentimentEffectConfig.groupId == sentimentEffectConfig.lastSentimentEffectId);
|
|
|
+ sentimentEffectWidget1 = sentimentEffectWidgets.FirstOrDefault(s =>
|
|
|
+ s.sentimentEffectConfig.groupId == sentimentEffectConfig.lastSentimentEffectId);
|
|
|
}
|
|
|
|
|
|
sentimentEffectWidget.CreatXian(XianRoot, sentimentEffectWidget1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void UpdateRestBtn()
|
|
|
+ {
|
|
|
+ bool isCanRest = false;
|
|
|
+ foreach (var sentimentDataSentimentProperty in sentimentData.sentimentProperties)
|
|
|
+ {
|
|
|
+ if (sentimentDataSentimentProperty.level >= 1)
|
|
|
+ {
|
|
|
+ isCanRest = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Btn_Rest.gameObject.SetActive(isCanRest);
|
|
|
+ }
|
|
|
+
|
|
|
private async void UpdateUi()
|
|
|
{
|
|
|
int level = curretnSentimentProperty.level <= 0 ? 1 : curretnSentimentProperty.level;
|
|
|
int conFigId = curretnSentimentProperty.groupId * 10 + level;
|
|
|
SentimentEffectConfig sentimentEffectConfig = ConfigComponent.Instance.Get<SentimentEffectConfig>(conFigId);
|
|
|
- currentGroupSentimentEffectConfigs = _sentimentEffectConfigs.Where(se => se.groupId == sentimentEffectConfig.groupId).ToList();
|
|
|
+ currentGroupSentimentEffectConfigs = _sentimentEffectConfigs
|
|
|
+ .Where(se => se.groupId == sentimentEffectConfig.groupId).ToList();
|
|
|
Text_Name.text = LanguageManager.Instance.Text(sentimentEffectConfig.name);
|
|
|
- Text_Desc.text = UtilTools.GetString(LanguageManager.Instance.Text(sentimentEffectConfig.massge), sentimentEffectConfig.effectVale);
|
|
|
+ Text_Desc.text = UtilTools.GetString(LanguageManager.Instance.Text(sentimentEffectConfig.massge),
|
|
|
+ sentimentEffectConfig.effectVale);
|
|
|
|
|
|
UIManager.Instance.DormancyGComponent(_itemWidgetType1);
|
|
|
_itemWidgetType1 = null;
|
|
|
- _itemWidgetType1 = await UIManager.Instance.CreateGComponentForObject<ItemWidgetType1>(ItemWidgetType1Gam, null);
|
|
|
+ _itemWidgetType1 =
|
|
|
+ await UIManager.Instance.CreateGComponentForObject<ItemWidgetType1>(ItemWidgetType1Gam, null);
|
|
|
_itemWidgetType1.CustomInit(sentimentEffectConfig.upConstItemId, sentimentEffectConfig.upConstCount);
|
|
|
|
|
|
if (curretnSentimentProperty.level >= currentGroupSentimentEffectConfigs.Count)
|