public bool SwitchVisibility(LiverPart part) { var GOpart = GetGameObject(part); Debug.Log("Just hit " + part.ToString()); if (GOpart == null) { Debug.Log("We're hitting null"); } bool isActive = GOpart.activeSelf; GOpart.SetActive(!isActive); return(!isActive); }
private GameObject GetGameObject(LiverPart part) { switch (part) { case LiverPart.Hepatic: return(Hepatic); case LiverPart.Parenchy: return(Parenchy); case LiverPart.Portal: return(Portal); case LiverPart.Tumor: return(Tumor); } return(Tumor); }