其他关卡条件log优化
parent
3688619081
commit
0966c97b66
|
|
@ -14,11 +14,10 @@ public class ConditionCharacter : ICondition
|
|||
public bool Check(List<float> args)
|
||||
{
|
||||
if (args.Count < 1)
|
||||
throw new ConditionException($"{nameof(ConditionCharacter)}条件,参数数量错误,需要1个参数,只有{args.Count}参数");
|
||||
throw new ConditionException($"{nameof(ConditionCharacter)}条件(是否拥有某个角色),需要1个参数,当前只有{args.Count}个参数,参数1:角色id");
|
||||
|
||||
uint id = (uint)args[0];
|
||||
CharacterDataInfo character = CharacterDataInfoManager.Instance.GetCharacterInfo((uint)args[0]);
|
||||
|
||||
CharacterDataInfo character = CharacterDataInfoManager.Instance.GetCharacterInfo(id);
|
||||
return character != null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,11 +14,9 @@ public class ConditionLevelPass : ICondition
|
|||
public bool Check(List<float> args)
|
||||
{
|
||||
if (args.Count < 1)
|
||||
throw new ConditionException($"{nameof(ConditionLevelPass)}条件,参数数量错误,需要1个参数,只有{args.Count}参数");
|
||||
throw new ConditionException($"{nameof(ConditionLevelPass)}条件(关卡是否通关),需要1个参数,当前只有{args.Count}个参数,参数1:关卡id");
|
||||
|
||||
int id = (int)args[0];
|
||||
|
||||
if (!LevelManager.Instance.TryGetLevelInfoByID(id, out LevelInfo levelInfo))
|
||||
if (!LevelManager.Instance.TryGetLevelInfoByID((int)args[0], out LevelInfo levelInfo))
|
||||
return false;
|
||||
|
||||
return levelInfo.IsPass;
|
||||
|
|
@ -27,7 +25,7 @@ public class ConditionLevelPass : ICondition
|
|||
public string[] GetArgLocalizations(List<float> args)
|
||||
{
|
||||
if (args.Count < 1)
|
||||
throw new ConditionException($"{nameof(ConditionLevelPass)}条件,参数数量错误,需要1个参数,只有{args.Count}参数");
|
||||
throw new ConditionException($"{nameof(ConditionLevelPass)}条件(关卡是否通关),需要1个参数,当前只有{args.Count}个参数,参数1:关卡id");
|
||||
|
||||
int id = (int)args[0];
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public class ConditionLevelStar : ICondition
|
|||
public bool Check(List<float> args)
|
||||
{
|
||||
if (args.Count < 2)
|
||||
throw new ConditionException($"{nameof(ConditionLevelStar)}条件,参数数量错误,需要2个参数,只有{args.Count}参数");
|
||||
throw new ConditionException($"{nameof(ConditionLevelStar)}条件(关卡星级是否满足),需要两个参数,当前只有{args.Count}个参数,参数1:关卡id,参数2:星级数量");
|
||||
|
||||
int id = (int)args[0];
|
||||
int star = (int)args[1];
|
||||
|
|
@ -27,11 +27,8 @@ public class ConditionLevelStar : ICondition
|
|||
public string[] GetArgLocalizations(List<float> args)
|
||||
{
|
||||
if (args.Count < 2)
|
||||
throw new ConditionException($"{nameof(ConditionLevelStar)}条件,参数数量错误,需要2个参数,只有{args.Count}参数");
|
||||
throw new ConditionException($"{nameof(ConditionLevelStar)}条件(关卡星级是否满足),需要两个参数,当前只有{args.Count}个参数,参数1:关卡id,参数2:星级数量");
|
||||
|
||||
int id = (int)args[0];
|
||||
int star = (int)args[1];
|
||||
|
||||
return new string[2] { id.ToString(), star.ToString() };
|
||||
return new string[2] { ((int)args[0]).ToString(), ((int)args[1]).ToString() };
|
||||
}
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@ public class ConditionPlayerSkillUpgradeLevel : ICondition
|
|||
public bool Check(List<float> args)
|
||||
{
|
||||
if (args.Count < 1)
|
||||
throw new ConditionException($"{nameof(ConditionPlayerSkillUpgradeLevel)}条件,参数数量错误,需要1个参数,只有{args.Count}参数");
|
||||
throw new ConditionException($"{nameof(ConditionPlayerSkillUpgradeLevel)}条件(指挥官技能是否解锁),需要1个参数,当前只有{args.Count}个参数,参数1:需要的等级");
|
||||
|
||||
int lv = (int)args[0];
|
||||
|
||||
|
|
@ -26,10 +26,8 @@ public class ConditionPlayerSkillUpgradeLevel : ICondition
|
|||
public string[] GetArgLocalizations(List<float> args)
|
||||
{
|
||||
if (args.Count < 1)
|
||||
throw new ConditionException($"{nameof(ConditionPlayerSkillUpgradeLevel)}条件,参数数量错误,需要1个参数,只有{args.Count}参数");
|
||||
throw new ConditionException($"{nameof(ConditionPlayerSkillUpgradeLevel)}条件(指挥官技能是否解锁),需要1个参数,当前只有{args.Count}个参数,参数1:需要的等级");
|
||||
|
||||
int lv = (int)args[0];
|
||||
|
||||
return new string[1] { lv.ToString() };
|
||||
return new string[1] { ((int)args[0]).ToString() };
|
||||
}
|
||||
}
|
||||
|
|
@ -101,15 +101,7 @@ namespace Gameplay.Guide
|
|||
if (null == curStep)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
curStep.Value.StartGuide();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugUtil.LogError(e);
|
||||
GuideManager.Instance.OnSkipGuide();
|
||||
}
|
||||
curStep.Value.StartGuide();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -227,6 +227,30 @@ namespace Gameplay.Guide
|
|||
BeginGuide(linkedCfg.Last.Value.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 跳过所有引导
|
||||
/// </summary>
|
||||
public void SkipAllGuide()
|
||||
{
|
||||
DebugUtil.Log("跳过所有引导");
|
||||
GuideConfig guideConfig = TableManager.Instance.Tables.GuideConfig;
|
||||
DataGuideCfg cfg = guideConfig.DataList[^1];
|
||||
NetHelper.SaveGuideProgress((uint)cfg.Id);
|
||||
EndGuide(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示跳过所有引导提示
|
||||
/// </summary>
|
||||
public void ShowSkipAllGuide()
|
||||
{
|
||||
UITipsManager.ShowConfirmTwo("脱离卡死",
|
||||
"是否强制跳过新手引导?(选择【跳过】便不再触发新手引导)",
|
||||
"跳过",
|
||||
"否",
|
||||
() => { SkipAllGuide(); }); // TODO 本地化
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 初始化数据
|
||||
/// </summary>
|
||||
|
|
@ -416,25 +440,10 @@ namespace Gameplay.Guide
|
|||
{
|
||||
DebugUtil.Log($"{SKIP_GUIDE_CHECK_TIME}秒内连续点击{SKIP_GUIDE_CLICK_COUNT}次,弹出强制跳过新手引导提示");
|
||||
queueTime.Clear();
|
||||
UITipsManager.ShowConfirmTwo("脱离卡死",
|
||||
"是否强制跳过新手引导?(选择【跳过】便不再触发新手引导)",
|
||||
"跳过",
|
||||
"否",
|
||||
() =>
|
||||
{
|
||||
OnSkipGuide();
|
||||
}); // TODO 本地化
|
||||
ShowSkipAllGuide();
|
||||
}
|
||||
else
|
||||
DebugUtil.Log($"[引导]记录两秒内的点击次数{queueTime.Count}");
|
||||
}
|
||||
|
||||
public void OnSkipGuide()
|
||||
{
|
||||
GuideConfig guideConfig = TableManager.Instance.Tables.GuideConfig;
|
||||
DataGuideCfg cfg = guideConfig.DataList[^1];
|
||||
NetHelper.SaveGuideProgress((uint)cfg.Id);
|
||||
EndGuide(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -241,6 +241,7 @@ namespace Gameplay.Guide
|
|||
catch (Exception e)
|
||||
{
|
||||
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
||||
GuideManager.Instance.SkipAllGuide();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -601,10 +602,10 @@ namespace Gameplay.Guide
|
|||
|
||||
LevelManager.Instance.TryEnterLevel(levelId, null, null, isPlay);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
||||
GuideManager.Instance.OnSkipGuide();
|
||||
GuideManager.Instance.ShowSkipAllGuide();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue