private void OpenInventory() { Inventory inventory = UIManager.GetMenu <Inventory>(); InGameMainMenu igmm = UIManager.GetMenu <InGameMainMenu>(); inventory.Open(true); igmm.OpenInventoryTransfer(true, false); }
public IEnumerator HarvestCoroutine() { harvestButton.enabled = false; Inventory inventory = UIManager.GetMenu <Inventory>(); float desiredTime = 1f; switch (myTier) { case Tier.first: desiredTime = 5f; break; case Tier.second: desiredTime = 10f; break; case Tier.third: desiredTime = 15f; break; default: break; } desiredTime = Mathf.Clamp(desiredTime - player.Stats.HarvestSpeed, 0f, 10f); float elapsedTime = 0f; while (elapsedTime < desiredTime) { fillIcon2.fillAmount = 1 - (elapsedTime / desiredTime); elapsedTime += Time.deltaTime; yield return(null); } fillIcon2.fillAmount = 1; int val = ingredient.amount; ingredient.amount = Mathf.RoundToInt(Random.Range(val - variance, val + variance)); inventory.AddInventoryItem(ingredient.ingredient, ingredient.amount); ingredient.amount = val; if (Random.Range(0f, 1f) < RareDropChance) { inventory.AddInventoryItem(rareIngredient.ingredient, rareIngredient.amount); } if (!inventory.IsActive) { inventory.Open(); } harvestButton.enabled = true; }
public void OpenInventoryTransfer(bool b = true, bool transfer = false) { if (b) { UIManager.Close <SystemMenu>(); UIManager.Close <LogMenu>(); if (!IsActive) { Open(); } Inventory inventory = UIManager.GetMenu <Inventory>(); inventory.Open(transfer); openInventoryToggle.Select(); Open(); } }