public static string GetCountText(int count, ClickTool clickTool) { if (clickTool.infiniteCharges) { return(""); } return(count > 0 ? count + "\nleft" : "0"); }
private ClickTool GetClickTool() { if (clickTool == null) { clickTool = FindObjectOfType <ClickTool>(); } return(clickTool); }
private int GetToolCharges(int toolIndex) { ClickTool clickTool = FindObjectOfType <ClickTool>(); if (toolIndex < clickTool.toolCharges.Length) { return(clickTool.toolCharges[toolIndex]); } return(0); }
public void UpdateSelectedToolAppearance() { int toolIndex = (int)selectedTool; selectedToolImage.sprite = GetToolSprite(toolIndex); ClickTool clickTool = FindObjectOfType <ClickTool>(); int count = GetToolCharges(toolIndex); selectedToolCount.text = ToolSelectUI.GetCountText(count, clickTool); GetCreateObjectUI().SetShowCursor(selectedTool == Tools.create); }
private void SelectAnyAvailableTool() { ClickTool clickTool = FindObjectOfType <ClickTool>(); for (int toolIndex = 0; toolIndex < clickTool.toolCharges.Length; toolIndex++) { if (clickTool.toolCharges[toolIndex] > 0) { SelectTool((Tools)toolIndex); break; } } }
public void UpdateAppearance() { ClickTool clickTool = FindObjectOfType <ClickTool>(); for (int i = 0; i < toolContainers.Length; i++) { int charges = clickTool.toolCharges[i]; GetCountTexts()[i].text = GetCountText(charges, clickTool); if (charges < 1 && !clickTool.infiniteCharges) { MainMenu.SetUIVisibility(toolContainers[i], false); } } }
private ClickTool GetClickTool() { if (clickTool == null) clickTool = FindObjectOfType<ClickTool>(); return clickTool; }
public static string GetCountText(int count,ClickTool clickTool) { if (clickTool.infiniteCharges) return ""; return count > 0 ? count + "\nleft" : "0"; }
private bool ShouldShowToolCharges() { ClickTool clickTool = FindObjectOfType <ClickTool>(); return(clickTool.HasAtLeastOneToolCharge() && gameMenuMode == GameMenuModes.gameplay); }