public EquipmentFSData GetFSDataByAttribute(AIHitParams attribute)
    {
        EquipmentFSData fsData = dataList.Find(delegate(EquipmentFSData testData)
        {
            return(testData.prop == attribute);
        });

        return(fsData);
    }
예제 #2
0
 private void AddAttribute(AIHitParams param, float value, Dictionary <AIHitParams, float> dict)
 {
     if (dict.ContainsKey(param))
     {
         dict[param] += value;
     }
     else
     {
         dict.Add(param, value);
     }
 }
예제 #3
0
 public float GetAttriubteValue(AIHitParams type)
 {
     foreach (PropertyScore propertyScore in _upgradeConfigData._attributeDataList._dataList)
     {
         if (propertyScore._type == type)
         {
             return(propertyScore._value);
         }
     }
     return(1.0f);
 }
	public static void Read()
	{
		bool newFile = false;

		TattooAttributeList dataList = null;

		UnityEngine.Object oldFile = AssetDatabase.LoadAssetAtPath(outFileName, typeof(TattooAttributeList));
		if (oldFile == null)
		{
			newFile = true;
			dataList = ScriptableObject.CreateInstance(typeof(TattooAttributeList)) as TattooAttributeList;
		}
		else
		{
			dataList = oldFile as TattooAttributeList;
		}

		dataList.dataList.Clear();

		string jsonStr = File.ReadAllText(fileName);

		JsonHashtable ht = FCJson.jsonDecode(jsonStr) as JsonHashtable;

        foreach (System.Object obj in ht.ValueList)
		{
			Hashtable ht2 = obj as Hashtable;


			AIHitParams param = (AIHitParams)Enum.Parse(typeof(AIHitParams), ht2["attribute"] as string);

			List<EnumTattooPart> parts = new List<EnumTattooPart>();

			dataList.dataList.Add(param);
		}

		if (newFile)
		{
			AssetDatabase.CreateAsset(dataList, outFileName);
		}
		else
		{
			EditorUtility.SetDirty(dataList);
		}
		Debug.Log(string.Format("Tattoo attributes imported OK. {0} records.", dataList.dataList.Count));
	}
예제 #5
0
 public float GetHitValueByParams(AIHitParams paramsKey)
 {
     if (paramsKey == attrId0)
     {
         return(attrValue0);
     }
     else if (paramsKey == attrId1)
     {
         return(attrValue1);
     }
     else if (paramsKey == attrId2)
     {
         return(attrValue2);
     }
     else
     {
         return(0);
     }
 }
예제 #6
0
 public float GetHitValueByParams(AIHitParams paramsKey)
 {
     if (paramsKey == attribute0)
     {
         return(value0);
     }
     else if (paramsKey == attribute1)
     {
         return(value1);
     }
     else if (paramsKey == attribute2)
     {
         return(value2);
     }
     else
     {
         return(0);
     }
 }
예제 #7
0
    public void AddHitParamsData(AIHitParams key, float value)
    {
        if (null == key || key == AIHitParams.None)
        {
            return;
        }

        HitParamsData paramaData = GetHitParamsData(key);

        if (null == paramaData)
        {
            paramaData       = new HitParamsData();
            paramaData.key   = key;
            paramaData.value = value;
            paramList.Add(paramaData);
        }
        else
        {
            paramaData.value += value;
        }
    }
예제 #8
0
    public string GetExtraAttributeValueDisplay(AIHitParams type, float value, Color color)
    {
        string valueStr;

        if (IsPercentFormat(type))
        {
            value    = value * 100;
            value    = Mathf.Round(value * 10) / 10.0f;
            valueStr = String.Format("{0:F1}", value) + "%";
        }
        else
        {
            value    = Mathf.Round(value * 10) / 10.0f;
            valueStr = value.ToString();
        }

        string colorString = NGUITools.EncodeColor(color);

        if (null != EquipmentFSDataList.GetFSDataByAttribute(type))
        {
            return(" [" + colorString + "] + " + valueStr + "[-]");
        }
        return("IDS_NULL");
    }
예제 #9
0
    public static AIHitParams GetHitParam(string data)
    {
        AIHitParams val = (AIHitParams)(System.Enum.Parse(typeof(AIHitParams), data));

        return(val);
    }
예제 #10
0
 public string GetExtraAttributeValueDisplay(AIHitParams type, float value)
 {
     return(GetExtraAttributeValueDisplay(type, value, new Color(190 / 255f, 170f / 255f, 130f / 255f)));
 }
예제 #11
0
 public string GetAttriubteDisplay(AIHitParams type, float value)
 {
     return(GetAttriubteDisplay(type, value, new Color(255f / 255f, 190f / 255f, 0f / 255f)));
 }
예제 #12
0
 public string GetAttriubteDisplay(AIHitParams type, float value, Color typeColor)
 {
     return(GetAttriubteDisplay(type, value, typeColor, new Color(190f / 255f, 170f / 255f, 130f / 255f)));
 }
예제 #13
0
    public float GetHitParamsValue(AIHitParams key)
    {
        HitParamsData paramaData = GetHitParamsData(key);

        return((null == paramaData) ? 0 : paramaData.value);
    }
예제 #14
0
    public HitParamsData GetHitParamsData(AIHitParams key)
    {
        HitParamsData paramaData = paramList.Find(delegate(HitParamsData data) { return(data.key == key); });

        return(paramaData);
    }
예제 #15
0
 public EquipmentAttributeVo(AIHitParams attr, float value)
 {
     this.attribute = attr;
     this.value     = value;
 }