void Destroy_Target(Notification_User_Target target) { Targets.Remove(target.User); target_parent.gameObject.SetActive(false); Destroy(target.gameObject); Utils.InvokeNextFrame(() => { target_parent.gameObject.SetActive(true); }); }
void Add_Suggested(User_Information info) { Notification_User_Target target = Instantiate(suggested_prefab, suggested_parent).GetComponent <Notification_User_Target>(); target.Initialize(info); target.GetComponent <Button>().onClick.AddListener(() => { Add_Target(target); }); }
public void Add_Target(Notification_User_Target suggested) { Destroy_Suggested(); Notification_User_Target target = Instantiate(target_prefab, target_parent).GetComponent <Notification_User_Target>(); target.Initialize(suggested.User); target.GetComponentInChildren <Button>().onClick.AddListener(() => { Destroy_Target(target); }); block = true; search_field.text = ""; block = false; Targets.Add(suggested.User); target_parent.gameObject.SetActive(false); Utils.InvokeNextFrame(() => { target_parent.gameObject.SetActive(true); }); }