private void generateItemGOHere(ItemsControl itemManager) { foreach (Item newItem in ItemsHere) { accessItem newitemScript = itemManager.createItemGO(newItem); newitemScript.transform.position = myPosition; } }
private void generateRandomItem(int currentLevel) { accessItem newItem = items.getRandomItem(currentLevel); Vector2Int newItemPosition = randomPosition(); newItem.transform.position = new Vector3(newItemPosition.x, 0, newItemPosition.y); }
private accessItem createItemGO(Item item) { print(item.ModelFilename); GameObject itemGO = (GameObject)Instantiate(Resources.Load(item.ModelFilename)); GameObject floatingTextGO = (GameObject)Instantiate(Resources.Load("FloatingText")); FloatingTextControl text = floatingTextGO.GetComponent <FloatingTextControl>(); IEnumerator doThis = delayedAccess(text, item.itemName, itemGO.transform); accessItem itemcs = itemGO.AddComponent <accessItem>(); itemcs.youAre(item); StartCoroutine(doThis); return(itemcs); }
internal void AddItem(accessItem item) { inventory.Add(item); Debug.Log("inventory has " + inventory.Count.ToString()); }