Пример #1
0
    public PlayerPropData GetPlayerPropDataByProp(PlayerPropKey key)
    {
        PlayerPropData playerPropData = dataList.Find(delegate(PlayerPropData testData)
        {
            return(testData.propKey == key);
        });

        return(playerPropData);
    }
Пример #2
0
 public static int PropFactor(PlayerPropKey propKey)
 {
     if ((int)propKey >= 32)
     {
         return(1000);
     }
     else
     {
         return(1);
     }
 }
Пример #3
0
    public bool IsPercentFormat(PlayerPropKey key)
    {
        switch (key)
        {
        case PlayerPropKey.Critical:
        case PlayerPropKey.CritDamage:
        case PlayerPropKey.ItemFind:
            return(true);

        default:
            return(false);
        }
    }
Пример #4
0
    public void RefreshKeyAndValue(PlayerPropKey key, float value)
    {
        UILabel        label          = GetComponent <UILabel>();
        PlayerPropData playerPropData = DataManager.Instance.PlayerPropDataList.GetPlayerPropDataByProp(key);

        if (PlayerPropKey.Level == key)
        {
            label.text = Localization.Localize("IDS_MESSAGE_GLOBAL_LEVEL") + " : [BEAA82]" + (int)value + "[-]";
        }
        else
        {
            string labelString = Localization.Localize(playerPropData.ids);
            switch (key)
            {
            case PlayerPropKey.FireDmg:
            case PlayerPropKey.FireRes:
            case PlayerPropKey.IceDmg:
            case PlayerPropKey.IceRes:
            case PlayerPropKey.LightningDmg:
            case PlayerPropKey.LightningRes:
            case PlayerPropKey.PosisonDmg:
            case PlayerPropKey.PosisonRes:
                labelString = labelString + " : ";
                break;

            default:
                labelString = labelString + " : ";
                break;
            }

            if (DataManager.Instance.IsPercentFormat(key))
            {
                value     *= 100;
                value      = (int)(value * 100) / 100.00f;
                label.text = labelString + "[BEAA82]" + value + "%[-]";
            }
            else
            {
                value      = (int)(value * 100) / 100.00f;
                label.text = labelString + "[BEAA82]" + value + "[-]";
            }
        }
    }
Пример #5
0
 public PlayerProp(PlayerPropKey key, int value)
 {
     this.Key   = key;
     this.Value = value;
 }