Phase2.1 添加武器tag配置和数据表定义
This commit is contained in:
@@ -15,7 +15,7 @@ namespace SepCore.CustomUtility
|
||||
|
||||
public static Rarity SelectRarity(LevelDropConfig dropConfig)
|
||||
{
|
||||
float total = dropConfig.WhiteWeight + dropConfig.GreenWeight + dropConfig.BlueWeight + dropConfig.PurpleWeight + dropConfig.RedWeight;
|
||||
float total = dropConfig.WhiteWeight + dropConfig.BlueWeight + dropConfig.PurpleWeight + dropConfig.RedWeight;
|
||||
if (total <= 0f)
|
||||
{
|
||||
Log.Error("LevelDropConfig '{0}' has invalid total weight '{1}'.", dropConfig.Id, total);
|
||||
@@ -25,8 +25,6 @@ namespace SepCore.CustomUtility
|
||||
float roll = Random.Range(0f, total);
|
||||
if (roll < dropConfig.WhiteWeight) return Rarity.White;
|
||||
roll -= dropConfig.WhiteWeight;
|
||||
if (roll < dropConfig.GreenWeight) return Rarity.Green;
|
||||
roll -= dropConfig.GreenWeight;
|
||||
if (roll < dropConfig.BlueWeight) return Rarity.Blue;
|
||||
roll -= dropConfig.BlueWeight;
|
||||
if (roll < dropConfig.PurpleWeight) return Rarity.Purple;
|
||||
|
||||
Reference in New Issue
Block a user