public void CloseMapMenu() { mapSFX.PlayMapSoundSFX(MapSFX.MapSoundEffect.ButtonPress); CheckHackCosts(); Debug.Log("is hack still active: " + hackTarget.GetIsActive()); List <HackTarget> hackTargets = FindObjectOfType <CurrentNodeMenu>().GetMapSquare().GetHackTargets(); FindObjectOfType <CurrentNodeMenuHacks>().SetupButtons(hackTargets); FindObjectOfType <CurrentNodeMenu>().UpdateEffectsButton(); gameObject.SetActive(false); }
public void SetupButton(HackTarget newHackTarget) { hackTarget = newHackTarget; Image image = GetComponent <Image>(); image.enabled = true; GetComponent <Button>().enabled = true; image.sprite = FindObjectOfType <MapSquareImageHolder>().GetButtonImageByName(hackTarget.getHackType(), hackTarget.GetIsActive()); if (!hackTarget.GetIsActive()) { GetComponent <Button>().enabled = false; } hackName.enabled = true; hackName.text = hackTarget.getHackType(); }