public void SpawnChar(MyController ctrl) { CharPanel panel = ((GameObject)Instantiate(charPanelTemplate)).GetComponent <CharPanel> (); panel.transform.SetParent(charSorter, false); panel.ctrl = ctrl; ctrl.panel = panel; registeredChars.Add(ctrl); }
public void ViewChar(Character character) { CharPanel.SetActive(true); Models.ButtonModel.CharPanelActive.Value = CharPanel.activeSelf; if (charView == null) { charView = CharPanel.GetComponent <CharView>(); } charView.ViewChar(character); ColonistsScrollView.SetActive(false); Models.ButtonModel.ColonistsViewActive.Value = ColonistsScrollView.activeSelf; }