public void ParseRemoveGameItem(string t, Passage p) { // removeItem:item-code-string try { int colon = t.IndexOf(':'); string gameItemCode = t.Substring(colon + 1); PlayerItemData itemData = DB.Instance.gameItems.GetPlayerItem(gameItemCode); var s = new RemoveGameItemSfStatement() { itemId = itemData.id }; p.effects.Add(s); } catch { Debug.LogError($"DialogueManager: Failed to parse tag {t}"); throw; } }
public void ShowForItem(PlayerItemData item, bool showYouGot) { shownAsItemInfo = !showYouGot; itemName.text = item.name; itemDescription.text = item.description; itemImage.sprite = item.image; youGot.gameObject.SetActive(showYouGot); float esw = LayoutManager.Instance.esw; var defaultMargins = LayoutManager.Instance.defaultMargins; itemDescription.fontSize = esw; itemDescription.margin = new Vector4(defaultMargins.x, defaultMargins.y, defaultMargins.z, defaultMargins.w + 20); closeBtnText.fontSize = esw; closeBtnText.margin = defaultMargins; Show(); LayoutRebuilder.ForceRebuildLayoutImmediate(mainPanel); LayoutRebuilder.ForceRebuildLayoutImmediate(mainPanel); LayoutRebuilder.ForceRebuildLayoutImmediate(mainPanel); }
public PlayerItemState(PlayerItemData playerData) { id = playerData.id; data = playerData; }