先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
100 lines
4.3 KiB
C#
100 lines
4.3 KiB
C#
using asap.core;
|
|
using cfg;
|
|
using GameCore;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class buff_tips : MonoBehaviour
|
|
{
|
|
public TMP_Text buff_time;
|
|
public TMP_Text buff_name;
|
|
public TMP_Text buff_content;
|
|
public Image buff_icon;
|
|
public int buffId;
|
|
public void InitPanel(FishBuff buff)
|
|
{
|
|
buffId = buff.ID;
|
|
string title = LocalizationMgr.GetText(buff.Title_l10n_key);
|
|
string desc = LocalizationMgr.GetText(buff.Desc_l10n_key);
|
|
string iconName = buff.Icon;
|
|
if (buff.BuffParam is ExtraGold)
|
|
{
|
|
ExtraGold extraGold = buff.BuffParam as ExtraGold;
|
|
desc = LocalizationMgr.GetFormatTextValue(buff.Desc_l10n_key, extraGold.Param.ToPercentageString());
|
|
}
|
|
else if (buff.BuffParam is CollectionTargetExtraPoint)
|
|
{
|
|
string str = "";
|
|
//新目标奖励活动特殊地图 Todo
|
|
str = GContext.container.Resolve<FishingEventData>().collectingTargetInit.Title_l10n_key;
|
|
str = LocalizationMgr.GetText(str);
|
|
CollectionTargetExtraPoint collectionTargetExtraPoint = buff.BuffParam as CollectionTargetExtraPoint;
|
|
desc = LocalizationMgr.GetFormatTextValue(buff.Desc_l10n_key, collectionTargetExtraPoint.Param.ToPercentageString(), str);
|
|
}
|
|
else if (buff.BuffParam is SpMapExtraPoint)
|
|
{
|
|
SpMapExtraPoint spMapExtraPoint = buff.BuffParam as SpMapExtraPoint;
|
|
desc = LocalizationMgr.GetFormatTextValue(buff.Desc_l10n_key, spMapExtraPoint.Param.ToPercentageString());
|
|
}
|
|
else if (buff.BuffParam is CollectionTargetWeight)
|
|
{
|
|
string str = "";
|
|
//新目标奖励活动 Todo
|
|
CollectionTargetWeight collectionTargetWeight = buff.BuffParam as CollectionTargetWeight;
|
|
CollectingTargetInit collectingTargetInit = GContext.container.Resolve<FishingEventData>().collectingTargetInit;
|
|
if (collectingTargetInit != null)
|
|
{
|
|
EventTargetExtraDrop eventTargetExtraDrop = collectingTargetInit.FishingExtraDrop;
|
|
if (eventTargetExtraDrop is ETKeepsake)
|
|
{
|
|
ETKeepsake eTKeepsake = eventTargetExtraDrop as ETKeepsake;
|
|
int fishItemId = eTKeepsake.FishIDList[collectionTargetWeight.TargetFishIndex - 1];
|
|
Item item = GContext.container.Resolve<Tables>().TbItem.GetOrDefault(fishItemId);
|
|
str = LocalizationMgr.GetText(item.Name_l10n_key);
|
|
iconName = collectingTargetInit.BuffIcon;
|
|
}
|
|
}
|
|
title = LocalizationMgr.GetFormatTextValue(buff.Title_l10n_key, str);
|
|
desc = LocalizationMgr.GetFormatTextValue(buff.Desc_l10n_key, str);
|
|
}
|
|
else if (buff.BuffParam is ConstructionCost)
|
|
{
|
|
ConstructionCost constructionCost = buff.BuffParam as ConstructionCost;
|
|
desc = LocalizationMgr.GetFormatTextValue(buff.Desc_l10n_key, constructionCost.Param.ToPercentageString());
|
|
|
|
}
|
|
else if (buff.BuffParam is SuperBomb)
|
|
{
|
|
SuperBomb superBomb = buff.BuffParam as SuperBomb;
|
|
desc = LocalizationMgr.GetFormatTextValue(buff.Desc_l10n_key, superBomb.CashBonus.ToPercentageString());
|
|
}
|
|
else if (buff.BuffParam is SuperRob)
|
|
{
|
|
SuperRob superRob = buff.BuffParam as SuperRob;
|
|
desc = LocalizationMgr.GetFormatTextValue(buff.Desc_l10n_key, superRob.CashBonus.ToPercentageString());
|
|
}
|
|
else if (buff.BuffParam is SuperHunt)
|
|
{
|
|
SuperHunt superHunt = buff.BuffParam as SuperHunt;
|
|
desc = LocalizationMgr.GetFormatTextValue(buff.Desc_l10n_key, superHunt.CashBonus.ToPercentageString());
|
|
}
|
|
else if (buff.BuffParam is SuperSavingPot)
|
|
{
|
|
SuperSavingPot superSavingPot = buff.BuffParam as SuperSavingPot;
|
|
desc = LocalizationMgr.GetFormatTextValue(buff.Desc_l10n_key, superSavingPot.Param.ToPercentageString());
|
|
}
|
|
|
|
buff_name.text = title;
|
|
buff_content.text = desc;
|
|
if (!string.IsNullOrEmpty(iconName))
|
|
{
|
|
GContext.container.Resolve<IUIService>().SetImageSprite(buff_icon, iconName);
|
|
}
|
|
}
|
|
public void SetBuffTime(string str)
|
|
{
|
|
buff_time.text = str;
|
|
}
|
|
}
|