private void ResetBar() { bar.SetValueToBarPercent(0, bar.toxicityBar); bar.SetValueToBarScalar(0, bar.healingBar, 100); Image greenBar = bar.toxicityBar.transform.parent.Find("GreenImage").GetComponent <Image>(); bar.SetValueToBarPercent(0, greenBar); }
IEnumerator LoadAsynchronously(string level) { loadingScreen.SetActive(true); yield return(new WaitForSeconds(0.5f)); AsyncOperation operation = SceneManager.LoadSceneAsync(level); while (!operation.isDone) { float progress = Mathf.Clamp01(operation.progress / .9f); filler.SetValueToBarPercent(progress * 100, filler.healingBar); yield return(null); } }
public void SetPanel(Characteristics ch) { if (!gameObject.activeInHierarchy) { gameObject.SetActive(true); } if (bar != null) { bar.SetValueToBarPercent(ch.toxicity, bar.toxicityBar); bar.SetValueToBarScalar(ch.healingRate, bar.healingBar, 100); } else if (Nametxt != null && craftHolder != null) { Nametxt.text = craftHolder.Talent.description.Name; } else if (Nametxt != null && recipeHolder != null) { Nametxt.text = recipeHolder.recipe.description.Name; } herbs.text = ch.healingPlantsNeeded.ToString(); chems.text = ch.chemistryNeeded.ToString(); plastic.text = ch.plasticNeeded.ToString(); }
public void DrawBar() { recipeBar.SetValueToBarScalar(RecipeSelector.recipeHolderSelected.recipe.characteristics.healingRate, recipeBar.healingBar, 100); recipeBar.SetValueToBarPercent(RecipeSelector.recipeHolderSelected.recipe.characteristics.toxicity, recipeBar.toxicityBar); var epidemies = FindObjectOfType <Seller>().EpidemiesCured; }