Przeglądaj źródła

fix:修复数值组件Update获取未赋值的的Key时 字典报错的问题 (#312)

* fix:修复数值组件Update获取未赋值的的Key时 字典报错的问题
zzj 3 lat temu
rodzic
commit
dd83d9b81b

+ 1 - 1
Unity/Codes/Model/Module/Numeric/NumericComponent.cs

@@ -106,7 +106,7 @@ namespace ET
 
 			// 一个数值可能会多种情况影响,比如速度,加个buff可能增加速度绝对值100,也有些buff增加10%速度,所以一个值可以由5个值进行控制其最终结果
 			// final = (((base + add) * (100 + pct) / 100) + finalAdd) * (100 + finalPct) / 100;
-			long old = this.NumericDic[final];
+			long old = this.GetByKey(final);
 			long result = (long)(((this.GetByKey(bas) + this.GetByKey(add)) * (100 + this.GetAsFloat(pct)) / 100f + this.GetByKey(finalAdd)) * (100 + this.GetAsFloat(finalPct)) / 100f);
 			this.NumericDic[final] = result;
 			Game.EventSystem.Publish(new EventType.NumbericChange()