fix(奖励): 修复等级奖励类型获取逻辑并添加空值检查
- 调整 getLevelRewardType 函数,仅在特定等级返回天赋类型,其他等级返回 null - 在 MissionComp.call_cards 中添加奖励类型空值检查,避免无效调用 - 为多个预制体组件统一添加 debugMode 默认值
This commit is contained in:
@@ -10,14 +10,12 @@ import { CardType, CardKind } from "./GameSet";
|
||||
* @returns 奖励类型 CardType
|
||||
*/
|
||||
export function getLevelRewardType(level: number): CardType {
|
||||
if (level === 1) {
|
||||
return CardType.Skill;
|
||||
} else if (level >= 2 && level <= 5) {
|
||||
return CardType.Talent;
|
||||
} else if (level === 6) {
|
||||
return CardType.Partner;
|
||||
} else {
|
||||
return CardType.Potion; // 以后暂时都是物品
|
||||
switch (level) {
|
||||
case 2: return CardType.Talent;
|
||||
case 5: return CardType.Talent;
|
||||
case 10: return CardType.Talent;
|
||||
default:
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user