public void SetData(TattooSuiteData data, UITattooSuiteQuery uiMake) { _caller = uiMake; suiteData = data; DisplayInfo(); }
public int GetTattooSuiteBearPoints(TattooSuiteData tsd) { int sum = 0; foreach (string tattooID in tsd.tdList) { TattooData td = this.GetTattooData(tattooID); sum += td.bearingPoint; } return(sum); }
public List <EnumTattooPart> GetTattooSuiteApplicablePositions(TattooSuiteData tsd) { List <EnumTattooPart> list = new List <EnumTattooPart>(); foreach (string tattooID in tsd.tdList) { TattooData td = this.GetTattooData(tattooID); foreach (EnumTattooPart part in td.applicableParts) { if (!list.Contains(part)) { list.Add(part); } } } return(list); }
void FillRecipeListGrid() { TattooSuiteData tsd = _focusItem.suiteData; int index = 0; //tattoo suites foreach (string tattooID in tsd.tdList) { UIRecipeItem2 uiItem; if (index < _tmList.Count) { uiItem = _tmList[index]; } else { GameObject go = NGUITools.AddChild(recipeListGrid.gameObject, recipeItem2Prefab); uiItem = go.GetComponent <UIRecipeItem2>(); _tmList.Add(uiItem); } int amount = PlayerInfo.Instance.PlayerInventory.GetItemCount(tattooID) + PlayerInfo.Instance.playerTattoos.GetTattooCount(tattooID); uiItem.SetData(tattooID, amount); uiItem.gameObject.SetActive(true); index++; } while (index < _tmList.Count) { _tmList[index++].gameObject.SetActive(false); } recipeListGrid.Reposition(); }
public static void Read() { bool newFile = false; TattooSuiteDataList dataList = null; UnityEngine.Object oldFile = AssetDatabase.LoadAssetAtPath(outFileName, typeof(TattooSuiteDataList)); if (oldFile == null) { newFile = true; dataList = ScriptableObject.CreateInstance(typeof(TattooSuiteDataList)) as TattooSuiteDataList; } else { dataList = oldFile as TattooSuiteDataList; } 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; TattooSuiteData newData = new TattooSuiteData(); newData.suiteID = ht2["tattooSuite"] as string; newData.nameIDS = ht2["name"] as string; newData.descIDS = ht2["description"] as string; newData.ord = (int)ht2["ord"]; newData.level = (int)ht2["level"]; newData.rareLevel = (int)ht2["rareLevel"]; newData.attribute0 = (AIHitParams)(int)ht2["attributeId0"]; newData.value0 = (float)ht2["value0"]; newData.attribute1 = (AIHitParams)(int)ht2["attributeId1"]; newData.value1 = (float)ht2["value1"]; newData.attribute2 = (AIHitParams)(int)ht2["attributeId2"]; newData.value2 = (float)ht2["value2"]; List <string> idList = new List <string>(); for (int i = 1; i < 11; i++) { string part = ht2["suitePart" + i.ToString()] as string; if (!string.IsNullOrEmpty(part)) { idList.Add(part); } else { break; } } newData.tdList = idList; dataList.dataList.Add(newData); } dataList.dataList.Sort(new MyComparer()); if (newFile) { AssetDatabase.CreateAsset(dataList, outFileName); } else { EditorUtility.SetDirty(dataList); } Debug.Log(string.Format("Tattoo Suite data imported OK. {0} records.", dataList.dataList.Count)); }
private void HandleTattooSuiteAttribute(TattooSuiteData tsd) { _owner.Data.AddHitParamsData(tsd.attribute0, tsd.value0); _owner.Data.AddHitParamsData(tsd.attribute1, tsd.value1); _owner.Data.AddHitParamsData(tsd.attribute2, tsd.value2); }
private void HandleTattooSuiteAttribute(TattooSuiteData tsd, Dictionary <AIHitParams, float> dict) { AddAttribute(tsd.attribute0, tsd.value0, dict); AddAttribute(tsd.attribute1, tsd.value1, dict); AddAttribute(tsd.attribute2, tsd.value2, dict); }