void Start() { toolSpawner = FindObjectOfType <ToolSpawner>(); SetCostLabel(); image = GetComponent <Image>(); image.color = deselectedColor; buttons = FindObjectsOfType <ToolButton>(); }
public void Select(ToolSpawner toolSpawner) { if (toolSpawner.tool) { currentTool = toolSpawner.tool; } foreach (ToolSpawner ts in toolSpawners) { if (ts != toolSpawner) { ts.Deselect(); } } }