// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player"); currentTarget = player; playerTex = player.GetComponentInChildren <SkinnedMeshRenderer>().materials[0]; playerTexTrans = player.GetComponentInChildren <SkinnedMeshRenderer>().materials[1]; poisonBubbles = GameObject.Find("PlayerPoisonParticles").GetComponent <ParticleSystem>(); inventoryAnchor = player.GetComponent <InventoryAnchor>(); }
public void ChangeInventories(int direction) { InventoryAnchor playerInvAnchor = PlayerManager.Instance.inventoryAnchor; currentInvIndex += direction; if (currentInvIndex >= playerInvAnchor.inventories.Count) { currentInvIndex = 0; } else if (currentInvIndex < 0) { currentInvIndex = playerInvAnchor.inventories.Count - 1; } inventory = playerInvAnchor.inventories[currentInvIndex]; subMenuTitle.text = inventory.name; ClearDisplay(); }